Skip to content

Commit

Permalink
Document order guarantees for [Tuple]Combinations adapters
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanavella authored and jswrenn committed Jan 11, 2024
1 parent 18657fa commit 2f4739c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1591,6 +1591,11 @@ pub trait Itertools: Iterator {
/// let it: TupleCombinations<Range<u32>, (u32, u32, u32)> = (1..5).tuple_combinations();
/// itertools::assert_equal(it, vec![(1, 2, 3), (1, 2, 4), (1, 3, 4), (2, 3, 4)]);
/// ```
///
/// # Guarantees
///
/// If the adapted iterator is deterministic,
/// this iterator adapter yields items in a reliable order.
fn tuple_combinations<T>(self) -> TupleCombinations<Self, T>
where
Self: Sized + Clone,
Expand Down Expand Up @@ -1629,6 +1634,11 @@ pub trait Itertools: Iterator {
/// vec![2, 2],
/// ]);
/// ```
///
/// # Guarantees
///
/// If the adapted iterator is deterministic,
/// this iterator adapter yields items in a reliable order.
#[cfg(feature = "use_alloc")]
fn combinations(self, k: usize) -> Combinations<Self>
where
Expand Down

0 comments on commit 2f4739c

Please sign in to comment.