itertools
itertools copied to clipboard
Extra iterator adaptors, iterator methods, free functions, and macros.
Those two adaptors are quite similar, except one handles an additional index. While specializing `nth/last/count` for them, I nearly wrote the same code. Before going further, I think they should...
Same as `try_collect()` except that I don't have to specify Vec as a type parameter
First, `Itertools::dedup_by[_with_count]` uses `FnMut(&Self::Item, &Self::Item) -> bool` while `Vec::dedup_by` uses `FnMut(&mut T, &mut T) -> bool`. It differs in mutability: `&` vs `&mut`. Not sure why yet. Second, `Vec::dedup_by_key` exists...
My #722 was rejected because it was not truly user-convenient nor truly performant but only in the middle. ### Observation But it can be more performant in some cases without...
It would be nice to have a `map_try_into` similar to [`map_into`](https://docs.rs/itertools/latest/itertools/trait.Itertools.html#method.map_into) already implemented (in #288, requested in #280). The signature would be something like ```rust fn map_try_into(self) -> impl Iterator...
Relates to #755. I didn't grab the output earlier (is there a way to print without re-benchmarking?) but this makes no difference to the performance. Submitting a PR for record...
Relates to #755 ``` $ cargo bench --bench specializations unique/fold unique/fold time: [11.672 µs 11.710 µs 11.753 µs] change: [-5.4377% -4.4270% -3.6741%] (p = 0.00 < 0.05) Performance has improved....
Relates to #755 ``` $ cargo bench --bench specializations unique_by/fold unique_by/fold time: [13.702 µs 13.732 µs 13.766 µs] change: [-6.8548% -6.5012% -6.1766%] (p = 0.00 < 0.05) Performance has improved....
This an alternative to #901 that I learnt from, it would close #901, close #588 and eventually solve most https://github.com/rust-itertools/itertools/labels/generic-container issues. - I reuse `Map` polished earlier. - Transform `GroupingMap[By]`...
I did some clean up with #878 but I also deprecated some parts recently so... Similarly to #223, I list deprecated parts that will eventually be removed: - [ ]...