Open oberien opened 3 years ago
And what about something that acts like iterator.map(function).flatten_ok()
?
Hmm, is it really best to have an _ok
version of just about everything?
Are these scenarios where it might be better to use something like https://docs.rs/fallible-iterator/0.2.0/fallible_iterator/trait.FallibleIterator.html that's specifically for the Result
case?
I feel the two projects should be merged. rust-itertools
and fallible-iterator
just include similar implementations but different interfaces.
Similar to #522, which defines
flatten_ok
, there could also be aflat_map_ok
which operates on anIntoIter<Item = Result<T, E>>
, applies a function toT
if the value isOk
and flattens the result of that function. It should be equivalent toiterator.map_ok(function).flatten_ok()
.