← Back to archive

Stdle #32 · comparisons · 2026-07-08

What does this Rust snippet output?

A past puzzle — fully playable. 4 attempts, hints on wrong guesses.

fn main() {
let x = -1;
let s = match x {
0 | 1 | 2 => "small",
n if n < 0 => "negative",
_ => "big",
};
println!("{}", s);
}
Comparisons
4 attempts left

Answer & explanation