zip combines two iterators into pairs, chain concatenates:
zip
chain
use std::Iter let a = [1, 2, 3] let b = [4, 5, 6] let zipped = Iter::from(a).zip(Iter::from(b)).collect() // [[1,4], [2,5], [3,6]] let chained = Iter::from(a).chain(Iter::from(b)).collect() // [1, 2, 3, 4, 5, 6]
Goal: Use Iter.zip to combine names and scores into pairs.
Iter.zip
Run the code to see the output
9 results