Open Niedzwiedzw opened 4 months ago
I am a bit reluctant to add many methods for fallible iterators because it seems to open the door for many many cases.
However, I reckon that this can not be easily written with Itertools::process_results
? Something like that maybe
iter.process_results(|t_it| t_it.map(try_flat_map).process_results(|u_it| ...))??
You have an iterator of results then you map the "ok" values to another iterators of results, then this is flattened, am I right? It seems to do a lot.
Do you have an usage example for this?
process_results
- I've never heard of it, I'll experiment with it, thanks! as for my use case, I needed something like this for recursively iterating a tree of elements and extracting each child is fallible
Managed to get it to work with Box<_>, maybe it can be further optimized by defining a custom iterator. I use it a lot, it's very helpful