|
|
@ -43,11 +43,11 @@ where
|
|
|
|
// Using `scan` here because it is able to stop the stream early
|
|
|
|
// Using `scan` here because it is able to stop the stream early
|
|
|
|
// if a failure occurs
|
|
|
|
// if a failure occurs
|
|
|
|
let mut found_error = None;
|
|
|
|
let mut found_error = None;
|
|
|
|
let out = <T as Product<U>>::product(stream.scan((), |(), elem| {
|
|
|
|
let out = <T as Product<U>>::product(stream.scan(&mut found_error, |error, elem| {
|
|
|
|
match elem {
|
|
|
|
match elem {
|
|
|
|
Ok(elem) => Some(elem),
|
|
|
|
Ok(elem) => Some(elem),
|
|
|
|
Err(err) => {
|
|
|
|
Err(err) => {
|
|
|
|
found_error = Some(err);
|
|
|
|
**error = Some(err);
|
|
|
|
// Stop processing the stream on error
|
|
|
|
// Stop processing the stream on error
|
|
|
|
None
|
|
|
|
None
|
|
|
|
}
|
|
|
|
}
|
|
|
|