Skip to content

Commit

Permalink
TupleCombinations is not lazy but must be used nonetheless
Browse files Browse the repository at this point in the history
  • Loading branch information
Philippe-Cholet authored and jswrenn committed May 16, 2024
1 parent 074c7fc commit d7c99d5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/adaptors/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ where
/// See [`.tuple_combinations()`](crate::Itertools::tuple_combinations) for more
/// information.
#[derive(Clone, Debug)]
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
#[must_use = "this iterator adaptor is not lazy but does nearly nothing unless consumed"]
pub struct TupleCombinations<I, T>
where
I: Iterator,
Expand Down
9 changes: 7 additions & 2 deletions tests/laziness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,15 @@ must_use_tests! {
while_some {
let _ = Panicking.map(Some).while_some();
}
#[ignore]
tuple_combinations {
tuple_combinations1 {
let _ = Panicking.tuple_combinations::<(_,)>();
}
#[should_panic]
tuple_combinations2 {
let _ = Panicking.tuple_combinations::<(_, _)>();
}
#[should_panic]
tuple_combinations3 {
let _ = Panicking.tuple_combinations::<(_, _, _)>();
}
combinations {
Expand Down

0 comments on commit d7c99d5

Please sign in to comment.