itertools
itertools copied to clipboard
Extra iterator adaptors, iterator methods, free functions, and macros.
Panicking in `std::fmt::Display` implementations is a glaring footgun. Here is an example, where you are guaranteed to spend several hours debugging it, and potentially you will never find a cause...
I wanted to write a function that was generic over `tuple_combinations` and I can't because I can't refer to `HasCombination`.
Fixes #963 I suggest we follow the same policy as the stdlib: https://std-dev-guide.rust-lang.org/policy/doc-alias.html And I agree with @VorpalBlade that [`comm`](https://www.man7.org/linux/man-pages/man1/comm.1.html) is a fitting alias. PS: Doc aliases requires rust 1.48...
I recently had the need for comparing sorted iterators to figure out which elements were only in the left, right or both iterators. This is basically the same operation as...
In my code I have the need to get the most recent index without having to store it every time I advance the `CharIndices
There is a function version of `zip_eq` already, but it appears that `zip_longest` is still only available as a method? Let me know if you think this is a worthwhile...
Closes #667 and maybe #307. I merely update the docs of `Itertools::format[_with]`, reformulations are welcome: > ⚠ This can happen discreetly and be hard to debug if used in _macros...
Hello, product in Python itertools can take an option `repeat`. It might be a good idea to add an implementation of this to itertools as well. This one seems good...
`.try_collect()` is for turning `Iterator` into `Result`. Can you create an equivalent method that turns `Iterator` into `Option`? Or perhaps implement it as a generic, as part of `try_collect()`? The...
As per #933 , this PR merges `MultiPeek` and `PeekNth` into a general private interface `MultiPeekGeneral`, with public type alias to define the compatible `MultiPeek` and `PeekNth` struct.