mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-04-24 16:42:36 +02:00
Suppress warnings for elevator exercise (#2668)
This commit is contained in:
parent
8b04a6dcb0
commit
5ab6fae9e9
@ -41,3 +41,13 @@ out of these structures.
|
||||
|
||||
{{#include exercise.rs:main}}
|
||||
```
|
||||
|
||||
<details>
|
||||
|
||||
- If students ask about `#![allow(dead_code)]` at the top of the exercise, it's
|
||||
necessary because the only thing we do with the `Event` type is print it out.
|
||||
Due to a nuance of how the compiler checks for dead code this causes it to
|
||||
think that the code is unused. They can ignore it for the purpose of this
|
||||
exercise.
|
||||
|
||||
</details>
|
||||
|
@ -12,10 +12,10 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#![allow(dead_code)]
|
||||
|
||||
// ANCHOR: solution
|
||||
// ANCHOR: event
|
||||
#![allow(dead_code)]
|
||||
|
||||
#[derive(Debug)]
|
||||
/// An event in the elevator system that the controller must react to.
|
||||
enum Event {
|
||||
|
Loading…
x
Reference in New Issue
Block a user