This package provide a generic way to "unwrap" a Vec<Result<T,E>>
into
Result<Vec<&T>, &E>
. Here is an example:
```rust
let valid: Vec
// happy path, no errors, just the values assert_eq!(vec![&1, &2, &3], valid.foldr().unwrap());
// sad path returns the error assert!(invalid.foldr().is_err()); ```
If you need to collect all errors you can use .foldr_bisect
. It converts
Vec<Result<T, E>>
, to (Vec<&T>, Vec<&E>)
.
```rust // happy path, no errors, return empty error vector asserteq!((vec![&1, &2, &3], vec![]), valid.foldrbisect());
// sad path, populate error vector let (ok, ) = invalid.foldrbisect(); assert_eq!(vec![&1, &2], ok); ```