mirror of
https://github.com/notohh/rustlings.git
synced 2024-11-21 21:42:23 -05:00
enums1 solution
This commit is contained in:
parent
d6fd251a73
commit
a2dfbd86da
2 changed files with 15 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
enum Message {
|
enum Message {
|
||||||
// TODO: define a few types of messages as used below
|
// TODO: Define a few types of messages as used below.
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
|
@ -1 +1,14 @@
|
||||||
// Solutions will be available before the stable release. Thank you for testing the beta version 🥰
|
#[derive(Debug)]
|
||||||
|
enum Message {
|
||||||
|
Quit,
|
||||||
|
Echo,
|
||||||
|
Move,
|
||||||
|
ChangeColor,
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
println!("{:?}", Message::Quit);
|
||||||
|
println!("{:?}", Message::Echo);
|
||||||
|
println!("{:?}", Message::Move);
|
||||||
|
println!("{:?}", Message::ChangeColor);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue