File tree Expand file tree Collapse file tree 3 files changed +6
-0
lines changed Expand file tree Collapse file tree 3 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,8 @@ must_use! {
27
27
flatten /** v.par_iter().flatten(); */
28
28
fold /** v.par_iter().fold(|| 0, |x, _| x); */
29
29
fold_with /** v.par_iter().fold_with(0, |x, _| x); */
30
+ try_fold /** v.par_iter().try_fold(|| 0, |x, _| Some(x)); */
31
+ try_fold_with /** v.par_iter().try_fold_with(0, |x, _| Some(x)); */
30
32
inspect /** v.par_iter().inspect(|_| {}); */
31
33
interleave /** v.par_iter().interleave(&v); */
32
34
interleave_shortest /** v.par_iter().interleave_shortest(&v); */
Original file line number Diff line number Diff line change @@ -114,6 +114,8 @@ fn clone_adaptors() {
114
114
check ( v. par_iter ( ) . flatten ( ) ) ;
115
115
check ( v. par_iter ( ) . with_max_len ( 1 ) . fold ( || 0 , |x, _| x) ) ;
116
116
check ( v. par_iter ( ) . with_max_len ( 1 ) . fold_with ( 0 , |x, _| x) ) ;
117
+ check ( v. par_iter ( ) . with_max_len ( 1 ) . try_fold ( || 0 , |_, & x| x) ) ;
118
+ check ( v. par_iter ( ) . with_max_len ( 1 ) . try_fold_with ( 0 , |_, & x| x) ) ;
117
119
check ( v. par_iter ( ) . inspect ( |_| ( ) ) ) ;
118
120
check ( v. par_iter ( ) . update ( |_| ( ) ) ) ;
119
121
check ( v. par_iter ( ) . interleave ( & v) ) ;
Original file line number Diff line number Diff line change @@ -125,6 +125,8 @@ fn debug_adaptors() {
125
125
check ( v. par_iter ( ) . map ( Some ) . flatten ( ) ) ;
126
126
check ( v. par_iter ( ) . fold ( || 0 , |x, _| x) ) ;
127
127
check ( v. par_iter ( ) . fold_with ( 0 , |x, _| x) ) ;
128
+ check ( v. par_iter ( ) . try_fold ( || 0 , |x, _| Some ( x) ) ) ;
129
+ check ( v. par_iter ( ) . try_fold_with ( 0 , |x, _| Some ( x) ) ) ;
128
130
check ( v. par_iter ( ) . inspect ( |_| ( ) ) ) ;
129
131
check ( v. par_iter ( ) . update ( |_| ( ) ) ) ;
130
132
check ( v. par_iter ( ) . interleave ( & v) ) ;
You can’t perform that action at this time.
0 commit comments