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

Document that IntoIterator allows for for...in sugar #23851

Closed
frewsxcv opened this issue Mar 30, 2015 · 3 comments · Fixed by #23899
Closed

Document that IntoIterator allows for for...in sugar #23851

frewsxcv opened this issue Mar 30, 2015 · 3 comments · Fixed by #23899

Comments

@frewsxcv
Copy link
Member

http://doc.rust-lang.org/core/iter/trait.IntoIterator.html

I think we should mention somewhere in the docs for IntoIterator that implementing this trait allows one to write:

let my_vec = vec![1, 10, 100];
for i in my_vec { ... }

instead of

let my_vec = vec![1, 10, 100];
for i in my_vec.iter() { ... }
@FreeFull
Copy link
Contributor

What about an explanation of for x in &values and for x in &mut values?

@frewsxcv
Copy link
Member Author

That seems more of a conceptual, in-depth question that should probably be answered in the Book rather than API documentation

@Gankra
Copy link
Contributor

Gankra commented Mar 31, 2015

@FreeFull Or would be good in the top-level Iterator or Collections docs.

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 a pull request may close this issue.

4 participants