← Back to archive

Stdle #9 · comparisons · 2026-06-15

What does this Rust snippet output?

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

fn main() {
let x: Option<i32> = None;
let r = match x {
Some(n) => n,
None => 0,
};
println!("{}", r);
}
Comparisons
4 attempts left

Answer & explanation