rust-itertools / itertools

Extra iterator adaptors, iterator methods, free functions, and macros.
https://docs.rs/itertools/
Apache License 2.0
2.76k stars 309 forks source link

Implement `DoubleEndedIterator` for `FilterOk` #947

Closed Xenira closed 6 months ago

Xenira commented 6 months ago

Should be doable with rfind unless there is a reason I overlooked.

Would be willing to implement this.

Philippe-Cholet commented 6 months ago

FlattenOk, MapSpecialCase (for MapOk, MapInto) are double ended and ProcessResults since a few weeks. FilterOk and FilterMapOk are not (yet) but it seems reasonable to me.

Specialization tests and benchmarks will need to be updated but that's simple to do.

Xenira commented 6 months ago

Like that? Have to admit, not entirely comprehending the test system yet.

Also not sure, if rfold needs custom impl. FlattenOk didn't have any. Edit: nvm, found it. So prob. yes.

Philippe-Cholet commented 6 months ago

@Xenira I did not notice before they were not double ended so thanks for this.