// And as a final example, one can also collect all elements of an iterator, and put them, e.g., in a vector.
fn filter_vec_by_divisor(v: &Vec<i32>, divisor: i32) -> Vec<i32> {
- v.iter().filter(|n| *n % divisor == 0).collect()
+ v.iter().map(|n| *n).filter(|n| *n % divisor == 0).collect()
}
// **Exercise 10.1**: Look up the [documentation of `Iterator`](http://doc.rust-lang.org/stable/std/iter/trait.Iterator.html) to learn about more functions