Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Our non-lazy adaptors #939

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion src/kmerge_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ where
///
/// See [`.kmerge_by()`](crate::Itertools::kmerge_by) for more
/// information.
#[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 KMergeBy<I, F>
where
I: Iterator,
Expand Down
13 changes: 9 additions & 4 deletions tests/laziness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ must_use_tests! {
let _ = Panicking.merge_join_by(Panicking, |_, _| true);
let _ = Panicking.merge_join_by(Panicking, Ord::cmp);
}
#[ignore]
#[should_panic]
kmerge {
let _ = Panicking.map(|_| Panicking).kmerge();
}
#[ignore]
#[should_panic]
kmerge_by {
let _ = Panicking.map(|_| Panicking).kmerge_by(|_, _| true);
}
Expand Down 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