itertools
itertools copied to clipboard
Add Itertools::enumerate_ok
This work was done as an exercise in a group that studies Rust in the format of mob programming.
Please let us know whether this seems appropriate for the itertools crate.
By the way, if anyone would like to study Rust in the format of mob programming consider learning more about it here: https://mobusoperandi.zulipchat.com/
Co-authored-by: Saatvik Shah [email protected] Co-authored-by: Roland Fredenhagen [email protected] Co-authored-by: Shahar Dawn Or [email protected] Co-authored-by: Preet Dua [email protected]
Can you say more about why you think this particular combination is common enough to belong in itertools?
(The code itself is fine, though could be improved with a few things, such as size_hint.)
@scottmcm here's an example. I hope it's not made too unreadable by the awkward attempt at de-duplication which turned out to produce quite a bit of type-wrangling: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=1bab9bc0bfa8e4d7e6a314a7bac7df7a