← Back to archive

Stdle #75 · iteration · 2026-08-20

What does this Rust snippet output?

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

fn main() {
let v: Vec<i32> =
(1..4).map(|x| x * x).collect();
println!("{:?}", v);
}
Iteration
4 attempts left

Answer & explanation