You've already forked comprehensive-rust
mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-06-27 19:18:59 +02:00
Suppress warnings for elevator exercise (#2668)
This commit is contained in:
@ -41,3 +41,13 @@ out of these structures.
|
|||||||
|
|
||||||
{{#include exercise.rs:main}}
|
{{#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
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
#![allow(dead_code)]
|
|
||||||
|
|
||||||
// ANCHOR: solution
|
// ANCHOR: solution
|
||||||
// ANCHOR: event
|
// ANCHOR: event
|
||||||
|
#![allow(dead_code)]
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
/// An event in the elevator system that the controller must react to.
|
/// An event in the elevator system that the controller must react to.
|
||||||
enum Event {
|
enum Event {
|
||||||
|
Reference in New Issue
Block a user