1
0
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:
Nicole L 2025-02-27 12:33:06 -08:00 committed by GitHub
parent 8b04a6dcb0
commit 5ab6fae9e9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 2 deletions

View File

@ -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>

View File

@ -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 {