itertools
itertools copied to clipboard
Extra iterator adaptors, iterator methods, free functions, and macros.
I'm planning on kicking off a 'spring cleaning' of itertools in the next week or two. My goals are to: 1. rustfmt the repo and integrate rustfmt into CI 2....
# Overview I want to suggest an improvement for the library -- the ability to use custom hashes (specifically interested in ahash). # Why? The standard library uses a sip...
### Motivation Currently [`Itertools::into_group_map`](https://docs.rs/itertools/0.8.0/itertools/trait.Itertools.html#method.into_group_map) returns `HashMap` which equals to `HashMap` with `RandomState` being https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html. Supporting `HashMap` where `S: BuildHasher + Default` will allow `into_group_map` to interoperate with hash maps that...
This might be specific enough that i need to roll my own solution, but here goes. I have a set of objects from which i need to iterate over all...
The try_collect method in itertools is shadowing the method of the same name in std::iter on nightly : https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.try_collect https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=97cdf9666d33eeca8a69acdd1e59948e ``` #![allow(unused)] #![feature(iterator_try_collect)] use itertools::Itertools; // 0.10.5 fn main() {...
I found myself wanting a try_fold_while... Since there fold_while is not in std, I don't suppose it's the right time to RFC try_fold_while in std. So, would it be accepted...
- `.try_product()` is a more convenient way of writing `.product::()` - `.try_sum()` is a more convenient way of writing `.sum::()` Modelled after [`.try_collect()`](https://docs.rs/itertools/latest/itertools/trait.Itertools.html#method.try_collect)
`with_prev`
This seems generally useful enough to us. Does anyone feel that we should attempt to contribute this to `Iterator` first? Co-authored-by: Warren Wise
I am currently solving [Advent of Code day 07 part 1](https://adventofcode.com/2023/day/7#part1), and wrote this code: ```rust let total_winnings: usize = puzzle_input .lines() .map(|line| line.parse::().unwrap()) .sorted() // Give each hand a...
It's often useful to keep track of the intermediate results in a fold, as in Haskell's `scanl`, for example if you want to turn a iterator of numbers into an...