File tree 2 files changed +6
-11
lines changed
2 files changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -1145,9 +1145,6 @@ pub trait Itertools : Iterator {
1145
1145
/// Iterator element type is `Vec<Self::Item>`. The iterator produces a new Vec per iteration,
1146
1146
/// and clones the iterator elements.
1147
1147
///
1148
- /// If the input iterator is empty, or `k` is 0, or `k` greater than the
1149
- /// length of the input iterator, the resultant iterator adaptor will be empty.
1150
- ///
1151
1148
/// ```
1152
1149
/// use itertools::Itertools;
1153
1150
///
@@ -1243,6 +1240,8 @@ pub trait Itertools : Iterator {
1243
1240
/// ]);
1244
1241
/// ```
1245
1242
///
1243
+ /// Note: The source iterator is collected lazily, and will not be
1244
+ /// re-iterated if the permutations adaptor is completed and re-iterated.
1246
1245
#[ cfg( feature = "use_std" ) ]
1247
1246
fn permutations ( self , k : usize ) -> Permutations < Self >
1248
1247
where Self : Sized ,
Original file line number Diff line number Diff line change @@ -3,15 +3,11 @@ use std::iter::once;
3
3
4
4
use super :: lazy_buffer:: LazyBuffer ;
5
5
6
- /// An iterator to iterate through all the `k`-permutations of a series of items.
6
+ /// An iterator adaptor that iterates through all the `k`-permutations of the
7
+ /// elements from an iterator.
7
8
///
8
- /// Source items are distinguished by their position, not value; so if there
9
- /// are identical items in the source, there will be some identical permutation
10
- /// iterations.
11
- ///
12
- /// Can be constructed from an in-memory list of items directly; or from an
13
- /// iterator, with the
14
- /// [`.permuatations()`](../trait.Itertools.html#method.permutations) method.
9
+ /// See [`.permutations()`](../trait.Itertools.html#method.permutations) for
10
+ /// more information.
15
11
#[ must_use = "iterator adaptors are lazy and do nothing unless consumed" ]
16
12
pub struct Permutations < I : Iterator > {
17
13
vals : LazyBuffer < I > ,
You can’t perform that action at this time.
0 commit comments