Skip to content

Commit

Permalink
Add generic tests for try_fold
Browse files Browse the repository at this point in the history
  • Loading branch information
cuviper committed Jun 19, 2018
1 parent b864f48 commit 800c736
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/compile_fail/must_use.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ must_use! {
flatten /** v.par_iter().flatten(); */
fold /** v.par_iter().fold(|| 0, |x, _| x); */
fold_with /** v.par_iter().fold_with(0, |x, _| x); */
try_fold /** v.par_iter().try_fold(|| 0, |x, _| Some(x)); */
try_fold_with /** v.par_iter().try_fold_with(0, |x, _| Some(x)); */
inspect /** v.par_iter().inspect(|_| {}); */
interleave /** v.par_iter().interleave(&v); */
interleave_shortest /** v.par_iter().interleave_shortest(&v); */
Expand Down
2 changes: 2 additions & 0 deletions tests/clones.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ fn clone_adaptors() {
check(v.par_iter().flatten());
check(v.par_iter().with_max_len(1).fold(|| 0, |x, _| x));
check(v.par_iter().with_max_len(1).fold_with(0, |x, _| x));
check(v.par_iter().with_max_len(1).try_fold(|| 0, |_, &x| x));
check(v.par_iter().with_max_len(1).try_fold_with(0, |_, &x| x));
check(v.par_iter().inspect(|_| ()));
check(v.par_iter().update(|_| ()));
check(v.par_iter().interleave(&v));
Expand Down
2 changes: 2 additions & 0 deletions tests/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ fn debug_adaptors() {
check(v.par_iter().map(Some).flatten());
check(v.par_iter().fold(|| 0, |x, _| x));
check(v.par_iter().fold_with(0, |x, _| x));
check(v.par_iter().try_fold(|| 0, |x, _| Some(x)));
check(v.par_iter().try_fold_with(0, |x, _| Some(x)));
check(v.par_iter().inspect(|_| ()));
check(v.par_iter().update(|_| ()));
check(v.par_iter().interleave(&v));
Expand Down

0 comments on commit 800c736

Please sign in to comment.