itertools
itertools copied to clipboard
Extra iterator adaptors, iterator methods, free functions, and macros.
This issue tracks two complimentary directions for improving our specialization tests: - @Philippe-Cholet noted that our specialization tests do not currently test partially-consumed iterators. - We should extend our specialization...
The use of tuples in Itertools::tuples() and friends is questionable: - It suggests that type heterogeneity in iterator output is possible, which isn't accurate - It requires underscore-heavy turbofishes in...
In addition to the tuple impls, it would be nice to have array impls for this.
Copy and pasted from the [libs-team api change proposal ](https://github.com/rust-lang/libs-team/issues/152)which likely isn't going through. Would this crate be a good place for an addition like this? # Proposal ## Problem...
Following the logic of _https://github.com/rust-itertools/itertools/issues/709#issuecomment-1616526337_: > I looked at the methods in `trait Iterator` to find the way the "std" considers "iterator ownership". > There are 4 cases: > >...
I've run into a pattern that I'm surprised isn't an iterator method or extension already (or if it is, I haven't found it): ```rust let slice = b"Hello world!"; let...
`peeking_next(&mut self, accept: impl FnOnce(..) ->bool)` can be implemented in terms of `peek(&mut self) -> Option` and `next`. Conversely, `peek` can be implemented in terms of `peeking_next`. So, they are...
I don't find iterator adapter like [`itertools.accumulate(iterable[, func, *, initial=None])`](https://docs.python.org/3/library/itertools.html#itertools.accumulate) in Rust itertools. It would be nice to add it in.
Starting with the use case that prompted this: ```Rust fn get_dir(path: &path::Path) -> io::Result { path.read_dir()? .filter_map(|content| content.ok()) .filter_partition(|content| content.file_type().ok().and_then(|file_type| file_type.is_file()) } ``` Basically the same thing as the normal...