Jack Wrenn
Jack Wrenn
This is very similar to [`Vec::drain`](https://doc.rust-lang.org/std/vec/struct.Vec.html#method.drain). Should it use the same name?
The trait approach is very close to how the core library implements slice indexing: it defines a trait, [`SliceIndex`](https://doc.rust-lang.org/core/slice/trait.SliceIndex.html), and then implements [`ops::Index` for all indices implementing that trait](https://doc.rust-lang.org/std/primitive.slice.html#impl-Index%3CI%3E). In...
Agree completely. Both of those changes are already incorporated into the playground URL I linked. :-)
Let's stick to mirroring `SliceIndex` as closely as possible: - `IterIndex` → `IteratorIndex` - `IterIndex::get` → `IteratorIndex::index` Could you also just make sure that indentation consistently uses four spaces? Right...
`iter_index` is fine, as it's just an internal implementation detail and not publically exposed.
Limit `IteratorIndex` to `Iterator` (that way it'll play nice with method chaining). The `usize` indexing case should be this: ``` impl IteratorIndex for usize where I: Iterator, { type Output...
I'm excited to merge this, but I want to first be sure we won't eventually be in conflict with the core library. I've opened an issue on @rust-lang/rust asking whether...
I'm of two minds. ## Approach 1: It's just a shorthand We could have a `get` method that's _just_ a shorthand for `nth`, `take` and `skip`. In this possibility, we...
> to deliberately provide something that std doesn't I've imported itertools for the express purpose of using `minmax` on floats so I wouldn't have to roll my own solution. I'm...
Here's a four-way showdown between some of the current options ([playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=3ba3c97d268d421a7031d9f932c10aea)): ```rust pub fn with_unfold() -> impl Iterator { use itertools::unfold; unfold((0, 1), |(current, next)| { *next += *current; *current...