mirror of
https://github.com/rust-lang/rustlings.git
synced 2024-12-26 00:00:03 +03:00
enums1 solution
This commit is contained in:
parent
d6fd251a73
commit
a2dfbd86da
|
@ -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