From efbc1ee74b280954e8ad761ef17273cb1c54db54 Mon Sep 17 00:00:00 2001 From: kangshifu <42248685+leikang123@users.noreply.github.com> Date: Tue, 29 Aug 2023 17:09:47 +0800 Subject: [PATCH] feat: add enums4.rs exercise --- exercises/enums/enums4.rs | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 exercises/enums/enums4.rs diff --git a/exercises/enums/enums4.rs b/exercises/enums/enums4.rs new file mode 100644 index 00000000..9194cb24 --- /dev/null +++ b/exercises/enums/enums4.rs @@ -0,0 +1,34 @@ +// enums4.rs +// +// Address all the TODOs to make the tests pass! + +// Execute `rustlings hint enums4` or use the `hint` watch subcommand for a +// hint. + +// I AM NOT DONE + + + +#[derive(Debug)] +enum Color { + Red, + Blue, + Yellow + +} +fn main() { + let color_lk = Color::Blue; + let Color_ll = Color :: Yellow; + match color_lk { + Color::Red => println!("{:?}",Color::Red), + Color::Blue => println!("{:?}",Color::Blue), + Color::Yellow => println!("{:?}",Color::Yellow) + + }; + match Color_ll{ + Color::Red => println!("{:?}",Color::Red), + Color::Blue => println!("{:?}",Color::Blue), + Color::Yellow => println!("{:?}",Color::Yellow) + + } +}