Skip to content

Commit cfa8a51

Browse files
MultiProduct: add some documentation
1 parent 1546dcb commit cfa8a51

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/adaptors/multi_product.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,24 @@ use crate::size_hint;
1313
/// See [`.multi_cartesian_product()`](crate::Itertools::multi_cartesian_product)
1414
/// for more information.
1515
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
16-
pub struct MultiProduct<I>(Option<MultiProductInner<I>>)
16+
pub struct MultiProduct<I>(
17+
/// `None` once the iterator has ended.
18+
Option<MultiProductInner<I>>,
19+
)
1720
where
1821
I: Iterator + Clone,
1922
I::Item: Clone;
2023

2124
#[derive(Clone)]
25+
/// Internals for `MultiProduct`.
2226
struct MultiProductInner<I>
2327
where
2428
I: Iterator + Clone,
2529
I::Item: Clone,
2630
{
31+
/// Holds the iterators.
2732
iters: Vec<MultiProductIter<I>>,
33+
/// It is `None` at the beginning then it holds the current item of each iterator.
2834
cur: Option<Vec<I::Item>>,
2935
}
3036

0 commit comments

Comments
 (0)