From cfa8a518cfd6a5255f0e5e9838b33b06c462937e Mon Sep 17 00:00:00 2001 From: Philippe-Cholet Date: Sun, 7 Jan 2024 16:22:05 +0100 Subject: [PATCH] `MultiProduct`: add some documentation --- src/adaptors/multi_product.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/adaptors/multi_product.rs b/src/adaptors/multi_product.rs index 8e5a261a7..e071b875d 100644 --- a/src/adaptors/multi_product.rs +++ b/src/adaptors/multi_product.rs @@ -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(Option>) +pub struct MultiProduct( + /// `None` once the iterator has ended. + Option>, +) where I: Iterator + Clone, I::Item: Clone; #[derive(Clone)] +/// Internals for `MultiProduct`. struct MultiProductInner where I: Iterator + Clone, I::Item: Clone, { + /// Holds the iterators. iters: Vec>, + /// It is `None` at the beginning then it holds the current item of each iterator. cur: Option>, }