itertools
itertools copied to clipboard
Extra iterator adaptors, iterator methods, free functions, and macros.
The `RefCell` is unnecessary, as all we're doing is `.take()`, which is also available on `Cell`: https://doc.rust-lang.org/stable/std/cell/struct.Cell.html#method.take https://github.com/rust-itertools/itertools/blob/943494c2be3977a42df701dfde90d903ae17d16d/src/format.rs#L14 This results in using more memory and generating more code than necessary.
Hello, this is my first contribution to a rust library, can somebody guide me a little out here? The idea is to complete the `cartesian_product` logic with a `cartesian_power` adaptor....
Could we make the grouping operations generic so they're able to produce collections other than `std::collections::HashMap`? I'm proposing turning ```rs fn into_group_map(self) -> HashMap ``` into ```rs fn into_group_map(self) ->...
Fix #601 anyway because this change will reduce one clone.
This PR rewrites the multi cartesian product iterator. The original goal was to fix #337 ; however, there was no nice way of storing the state associated with that (besides...
I was bit surprised by that `Itertools::tuple_windows` is not somewhat lazy and has side effect. It is consuming the first tuple when calling `Itertools::tuple_windows` . https://doc.rust-lang.org/nightly/core/iter/index.html#laziness says that adapters in...
Calling `Iterate::next` fetches "the next after next" element [here](https://github.com/rust-itertools/itertools/blob/master/src/sources.rs#L159) then returns the actual "next" element. This behavior sometimes triggers unintended panics when overiteration is intended to be guarded by e.g....
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...
This allows use the equal value or to default it, which otherwise is cumbersome and complex as indicated in this example from `nameless`: ```diff diff --git a/examples/text-cat.rs b/examples/text-cat.rs index de1ceea..aac4db5...
This is a continuation of [my rejected PR to the stdlib](https://github.com/rust-lang/rust/pull/92665) for itertools. The `peeking_map_while` functions and associated functions are similar to `peeking_take_while` except this maps a `Option` to `Option`....