let squared: Vec = v.iter() .map(|x| x * x) .collect(); println!("{:?}", squared); // [1, 4, 9, 16, 25]