Challenge 1: Filter, Map, Collect Odd Squares — Possible Solution ==================================================================== fn main() { let numbers = vec![1, 2, 3, 4, 5]; let odd_squares: Vec = numbers .iter() .filter(|&&n| n % 2 != 0) .map(|&n| n * n) .collect(); println!("{:?}", odd_squares); // [1, 9, 25] } WHY THIS WORKS AS AN ANSWER ------------------------------ .iter() creates an iterator of references over numbers WITHOUT consuming it — numbers remains a valid, usable Vec after this whole chain runs, exactly the borrowing behavior this chapter described. .filter(|&&n| n % 2 != 0) keeps only the odd numbers — the double reference pattern (&&n) exists because .iter() yields &i32 references, so the filter closure receives a reference TO a reference; destructuring both layers with &&n gives a plain i32 to compare against. .map(|&n| n * n) then squares each surviving element — here only a single & is needed, since filter's own reference layer was already consumed by the previous step, leaving a plain &i32 for map to destructure once. .collect() finally consumes the whole lazy chain and builds the resulting Vec — the explicit let odd_squares: Vec annotation tells collect() exactly what to build, avoiding this chapter's own "type annotations needed" gotcha.