itertools icon indicating copy to clipboard operation
itertools copied to clipboard

Extra iterator adaptors, iterator methods, free functions, and macros.

Results 211 itertools issues
Sort by recently updated
recently updated
newest added

I just tried to use `with_position`, and realized that its `Item` is an [enum wrapping the actual item](https://docs.rs/itertools/latest/itertools/enum.Position.html): ``` pub enum Position { First(T), Middle(T), Last(T), Only(T), } ``` This...

See this Stack Overflow issue: https://stackoverflow.com/questions/74002179/chunks-still-borrowed-when-returning-iterator/74002346#74002346

This PR allows `PeekingNext` to be used as a trait object just like `Iterator`, allowing code to accept types like `&mut dyn PeekingNext` for some item type `T`. To accomplish...

This PR implements `PeekingNext` for `PeekingTakeWhile` by composing its predicate with the predicate given to `PeekingNext::peeking_next`. This allows `Itertools::peeking_take_while` to be chained and for subsequent calls, including those across function...

Similar to the existing `take_while_ref` but with a number of elements instead of a closure.

Hi, after 80 merged PRs fixing, modifying, testing, benchmarking, specializing or whatever really... I just checked this is my first PR where I actually add a "_brand new_" feature myself....

At the moment, this is only a proof of concept, but it would close #588 (and eventually solve some issues, see https://github.com/rust-itertools/itertools/labels/generic-container). - I wrote a straightforward _private_ trait generalizing...

generic-container

this iterator would be a wrapper for `iterator.process_results(|items| items.map(|item| item))` when either raising the first error, or successfully raising an `impl Iterator` into a `Result`. I find this particularily useful...

fallible-iterator

There were some lifetime issues that I was running into trying to directly raise an `impl Iterator` to a `Result` saying something along the lines that the lifetimes were incompatible....

fallible-iterator

Closes #447. So much changes happened since this work was initiated that rebase on top of master seems nothing less than a nightmare to me (I know, I tried). I...