Use Vec::iter().zip() to pair elements from two vectors into an iterator of tuples.
Use the iter().zip() method to pair elements from two Vecs into an iterator of tuples.
let a = vec![1, 2, 3];
let b = vec!['a', 'b', 'c'];
let zipped: Vec<(i32, char)> = a.iter().zip(b.iter()).collect();
This creates a new Vec containing (&1, &'a'), (&2, &'b'), and (&3, &'c').
Zipping combines two lists into pairs, matching the first item of the first list with the first item of the second list, and so on. It's like pairing up socks from two different piles. You use this when you need to process two related datasets simultaneously.