All games

Match Maker

Choose enum variants and match arms to handle different states.

Challenge 1 of 3Score 0 / 3

Choose a fan state that prints Speed: low.

main.rs
enum Fan {
    Off,
    Low,
    High,
}

fn main() {
    match /* choose below */ {
        Fan::Off => println!("Fan off"),
        Fan::Low => println!("Speed: low"),
        Fan::High => println!("Speed: high"),
    }
}
Choose an action
Back to the lesson