File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -21,11 +21,11 @@ where
2121 // if a failure occurs
2222 let mut found_error = None ;
2323 let out: V = stream
24- . scan ( ( ) , |( ) , elem| {
24+ . scan ( & mut found_error , |error , elem| {
2525 match elem {
2626 Ok ( elem) => Some ( elem) ,
2727 Err ( err) => {
28- found_error = Some ( err) ;
28+ * * error = Some ( err) ;
2929 // Stop processing the stream on error
3030 None
3131 }
Original file line number Diff line number Diff line change @@ -43,11 +43,11 @@ where
4343 // Using `scan` here because it is able to stop the stream early
4444 // if a failure occurs
4545 let mut found_error = None ;
46- let out = <T as Product < U > >:: product ( stream. scan ( ( ) , |( ) , elem| {
46+ let out = <T as Product < U > >:: product ( stream. scan ( & mut found_error , |error , elem| {
4747 match elem {
4848 Ok ( elem) => Some ( elem) ,
4949 Err ( err) => {
50- found_error = Some ( err) ;
50+ * * error = Some ( err) ;
5151 // Stop processing the stream on error
5252 None
5353 }
Original file line number Diff line number Diff line change @@ -43,11 +43,11 @@ where
4343 // Using `scan` here because it is able to stop the stream early
4444 // if a failure occurs
4545 let mut found_error = None ;
46- let out = <T as Sum < U > >:: sum ( stream. scan ( ( ) , |( ) , elem| {
46+ let out = <T as Sum < U > >:: sum ( stream. scan ( & mut found_error , |error , elem| {
4747 match elem {
4848 Ok ( elem) => Some ( elem) ,
4949 Err ( err) => {
50- found_error = Some ( err) ;
50+ * * error = Some ( err) ;
5151 // Stop processing the stream on error
5252 None
5353 }
You can’t perform that action at this time.
0 commit comments