Skip to content

Commit 2f4739c

Browse files
ryanavellajswrenn
authored andcommitted
Document order guarantees for [Tuple]Combinations adapters
1 parent 18657fa commit 2f4739c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/lib.rs

+10
Original file line numberDiff line numberDiff line change
@@ -1591,6 +1591,11 @@ pub trait Itertools: Iterator {
15911591
/// let it: TupleCombinations<Range<u32>, (u32, u32, u32)> = (1..5).tuple_combinations();
15921592
/// itertools::assert_equal(it, vec![(1, 2, 3), (1, 2, 4), (1, 3, 4), (2, 3, 4)]);
15931593
/// ```
1594+
///
1595+
/// # Guarantees
1596+
///
1597+
/// If the adapted iterator is deterministic,
1598+
/// this iterator adapter yields items in a reliable order.
15941599
fn tuple_combinations<T>(self) -> TupleCombinations<Self, T>
15951600
where
15961601
Self: Sized + Clone,
@@ -1629,6 +1634,11 @@ pub trait Itertools: Iterator {
16291634
/// vec![2, 2],
16301635
/// ]);
16311636
/// ```
1637+
///
1638+
/// # Guarantees
1639+
///
1640+
/// If the adapted iterator is deterministic,
1641+
/// this iterator adapter yields items in a reliable order.
16321642
#[cfg(feature = "use_alloc")]
16331643
fn combinations(self, k: usize) -> Combinations<Self>
16341644
where

0 commit comments

Comments
 (0)