Skip to content

Conversation

@thestinger
Copy link
Contributor

No description provided.

@jfager
Copy link
Contributor

jfager commented Jun 21, 2013

Is 'for foo.iter().enumerate().advance |(i, ee)|' going to be the blessed way to iterate with an index going forward? Or is this just a stopgap? It would be really disappointing if this were the final form, imo.

@thestinger
Copy link
Contributor Author

@jfager: for loops are going to be switched to external iterators, so the .advance will go away everywhere

An Iterable trait can provide enumerate as a default method.

The sooner these changes are done, the sooner it will look good without being crippled like our current iteration protocol.

An Iterator implementation can be made for &const [T] if it turns out
to be necessary for some use case.
replaced by the `enumerate` method from std::iterator
The removed test for issue #2611 is well covered by the `std::iterator`
module itself.

This adds the `count` method to `IteratorUtil` to replace `EqIter`.
@bors bors closed this Jun 21, 2013
@bors bors merged commit 06bec77 into rust-lang:master Jun 21, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jun 3, 2021
Fix `redundant_closure` for `vec![]` macro in a closure with arguments

fixes: rust-lang#7224
changelog: Fix `redundant_closure` for `vec![]` macro in a closure with arguments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants