Post
I think you could replace starting at .collect() with .map(|result| result .map(/* your Ok value logic */)) .take_until(|result| result .is_err() .fold(|result| { let aggregate = result?/* rest of the fold logic here */ }) I use [take_until](docs.rs/take-until/l...), but take_while could work too
docs.rsTakeUntilExt in take_until - RustTakeUntilExt is an extension trait for iterators. It adds the `Self::take_until` method.
No replies yet.