mirror of
https://github.com/rust-lang/rustlings.git
synced 2024-12-27 07:46:29 +00:00
43 lines
421 B
Rust
43 lines
421 B
Rust
|
// enums1.rs
|
||
|
// Make me compile! Scroll down for hints!
|
||
|
|
||
|
#[derive(Debug)]
|
||
|
enum Message {
|
||
|
// TODO: define a few types of messages as used below
|
||
|
}
|
||
|
|
||
|
fn main() {
|
||
|
println!("{:?}", Message::Quit);
|
||
|
println!("{:?}", Message::Echo);
|
||
|
println!("{:?}", Message::Move);
|
||
|
println!("{:?}", Message::ChangeColor);
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
// Hint: The declaration of the enumeration type has not been defined yet.
|