Skip to content
Quiz · Enums and match · lesson 8 of 8

Quiz — a guard and a range

What does the program print?

Rust
fn main() {
    let n = 7;
    let size = match n {
        x if x < 0 => "negative",
        0 => "zero",
        1..=9 => "small",
        _ => "large",
    };
    println!("{size}");
}