Skip to content

Commit

Permalink
MultiProduct: add some documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Philippe-Cholet committed Jan 7, 2024
1 parent 1546dcb commit cfa8a51
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/adaptors/multi_product.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,24 @@ use crate::size_hint;
/// See [`.multi_cartesian_product()`](crate::Itertools::multi_cartesian_product)
/// for more information.
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
pub struct MultiProduct<I>(Option<MultiProductInner<I>>)
pub struct MultiProduct<I>(
/// `None` once the iterator has ended.
Option<MultiProductInner<I>>,
)
where
I: Iterator + Clone,
I::Item: Clone;

#[derive(Clone)]
/// Internals for `MultiProduct`.
struct MultiProductInner<I>
where
I: Iterator + Clone,
I::Item: Clone,
{
/// Holds the iterators.
iters: Vec<MultiProductIter<I>>,
/// It is `None` at the beginning then it holds the current item of each iterator.
cur: Option<Vec<I::Item>>,
}

Expand Down

0 comments on commit cfa8a51

Please sign in to comment.