Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Drop the iter() from vec. #17301

Closed
sandeep-datta opened this issue Sep 16, 2014 · 1 comment
Closed

Feature request: Drop the iter() from vec. #17301

sandeep-datta opened this issue Sep 16, 2014 · 1 comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@sandeep-datta
Copy link
Contributor

Please consider dropping the additional call to iter() in the following code...

let vec = vec![1i, 2i, 3i];
for i in vec.iter() {
    println!("{}", i);
}

Preferred...

for i in vec {
    println!("{}", i);
}
@thestinger thestinger added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Sep 16, 2014
@alexcrichton
Copy link
Member

Changes such as this require an RFC, and this is actually enabled by this RFC's design of Iterable: rust-lang/rfcs#235. I'd recommending watching that to get updates on it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

No branches or pull requests

3 participants