rustlings/exercises/08_enums/enums1.rs

21 lines
352 B
Rust
Raw Normal View History

2019-10-29 06:49:49 +03:00
// enums1.rs
//
// No hints this time! ;)
2019-10-29 06:49:49 +03:00
#[derive(Debug)]
enum Message {
// TODO: define a few types of messages as used below
2024-02-01 00:54:23 +03:00
Quit,
Echo,
Move,
ChangeColor
2019-10-29 06:49:49 +03:00
}
2024-02-01 00:54:23 +03:00
2019-10-29 06:49:49 +03:00
fn main() {
println!("{:?}", Message::Quit);
println!("{:?}", Message::Echo);
println!("{:?}", Message::Move);
println!("{:?}", Message::ChangeColor);
}