orx_iterable/transformations/
zipped.rs

1use crate::Iterable;
2
3/// An iterable created by zipping two iterables.
4pub struct Zipped<I1, I2>
5where
6    I1: Iterable,
7    I2: Iterable,
8{
9    pub(crate) it1: I1,
10    pub(crate) it2: I2,
11}
12
13impl<I1, I2> Iterable for Zipped<I1, I2>
14where
15    I1: Iterable,
16    I2: Iterable,
17{
18    type Item = (I1::Item, I2::Item);
19
20    type Iter = core::iter::Zip<I1::Iter, I2::Iter>;
21
22    fn iter(&self) -> Self::Iter {
23        self.it1.iter().zip(self.it2.iter())
24    }
25}