You've already forked comprehensive-rust
mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-07-06 06:27:53 +02:00
Clarify completion condition for elevator exercise (#1574)
Addresses the first part of #1565.
This commit is contained in:
committed by
GitHub
parent
f04e277744
commit
e765159be1
@ -15,9 +15,11 @@
|
||||
#![allow(dead_code)]
|
||||
|
||||
// ANCHOR: solution
|
||||
// ANCHOR: event
|
||||
#[derive(Debug)]
|
||||
/// An event in the elevator system that the controller must react to.
|
||||
enum Event {
|
||||
// ANCHOR_END: event
|
||||
/// A button was pressed.
|
||||
ButtonPressed(Button),
|
||||
|
||||
@ -34,12 +36,14 @@ enum Event {
|
||||
/// A floor is represented as an integer.
|
||||
type Floor = i32;
|
||||
|
||||
// ANCHOR: direction
|
||||
/// A direction of travel.
|
||||
#[derive(Debug)]
|
||||
enum Direction {
|
||||
Up,
|
||||
Down,
|
||||
}
|
||||
// ANCHOR_END: direction
|
||||
|
||||
/// A user-accessible button.
|
||||
#[derive(Debug)]
|
||||
|
Reference in New Issue
Block a user