File tree 3 files changed +6
-6
lines changed
3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -21,11 +21,11 @@ where
21
21
// if a failure occurs
22
22
let mut found_error = None ;
23
23
let out: V = stream
24
- . scan ( ( ) , |( ) , elem| {
24
+ . scan ( & mut found_error , |error , elem| {
25
25
match elem {
26
26
Ok ( elem) => Some ( elem) ,
27
27
Err ( err) => {
28
- found_error = Some ( err) ;
28
+ * * error = Some ( err) ;
29
29
// Stop processing the stream on error
30
30
None
31
31
}
Original file line number Diff line number Diff line change @@ -43,11 +43,11 @@ where
43
43
// Using `scan` here because it is able to stop the stream early
44
44
// if a failure occurs
45
45
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| {
47
47
match elem {
48
48
Ok ( elem) => Some ( elem) ,
49
49
Err ( err) => {
50
- found_error = Some ( err) ;
50
+ * * error = Some ( err) ;
51
51
// Stop processing the stream on error
52
52
None
53
53
}
Original file line number Diff line number Diff line change @@ -43,11 +43,11 @@ where
43
43
// Using `scan` here because it is able to stop the stream early
44
44
// if a failure occurs
45
45
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| {
47
47
match elem {
48
48
Ok ( elem) => Some ( elem) ,
49
49
Err ( err) => {
50
- found_error = Some ( err) ;
50
+ * * error = Some ( err) ;
51
51
// Stop processing the stream on error
52
52
None
53
53
}
You can’t perform that action at this time.
0 commit comments