Fix the Enum
This program has two bugs! The programmer tried to use an enum with data, but made some mistakes.
Can you find and fix the errors so the program compiles and runs?
Hint: Look at how the enum variants are defined and how they're used. Does the data match up?
rust
enum Drink {
Water,
Juice(String),
Smoothie(String, String),
}
fn main() {
let my_drink = Drink::Juice("apple");
match my_drink {
Drink::Water => println!("Just water, thanks!"),
Drink::Juice(flavor) => println!("{} juice, yum!", flavor),
Drink::Smoothie(fruit) => println!("{} smoothie!", fruit),
}
}