rustlings/exercises/enums/enums2.rs
Xander b09049b906 feat: Added exercises/enums
Added 3 new exercises for enums, enums{1-3}.rs
2019-08-25 11:29:10 -04:00

51 lines
612 B
Rust

// enums2.rs
// Make me compile by putting your favorite fruit in the print statement :)
// Hints can be found below
// For extra challenge add your favorite fruit to the enum and print that :)
#[derive(Debug)]
enum Fruit {
Banana,
Apple,
Pear,
Mango
}
fn main() {
// Assign this variable to your favorite fruit
// let fruit = ???;
println!("I like {:#?}", favorite);
}
// Rust uses a certain sytax for getting a particular value from an enum. You
// can find enums in the "Enums and Pattern Matching" section of the Rust Book,
// starting on page 113