Skip to main content

zip

Function zip 

Source
pub fn zip<A, B>(a: A, b: B) -> Zip<A::Lender, B::Lender>
where A: IntoLender, B: IntoLender,
Expand description

Zips two lenders into a single lender of pairs.

This is the lender equivalent of Iterator::zip.

ยงExamples

let a = [1, 2, 3].iter().into_lender();
let b = [4, 5, 6].iter().into_lender();

let mut zipped = lender::zip(a, b);

assert_eq!(zipped.next(), Some((&1, &4)));
assert_eq!(zipped.next(), Some((&2, &5)));
assert_eq!(zipped.next(), Some((&3, &6)));
assert_eq!(zipped.next(), None);