A quick multiple-choice check before you move on. Answer every question, then submit to see how you did.
1.Given let p = v.iter().map(|n| { println!("{n}"); n * 2 }); where v is a Vec<i32>, at what point does the closure inside map first run and print?
2.Why does let v = (1..=5).collect(); fail to compile while let v: Vec<i32> = (1..=5).collect(); succeeds?
3.You have let mut v = vec![10, 20, 30]; and want to add 1 to each element in place without moving or replacing the Vec. Which iterator method yields the right thing to do this?
4.You implement the Iterator trait for a struct Countdown by defining type Item and next(). What do you then get for methods like map, filter, and sum?
5.According to the module, how does a Rust iterator chain like (1..=1000).filter(...).map(...).sum() differ at runtime from the equivalent C# LINQ chain?