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

API Docs: std::iter #29360

Closed
steveklabnik opened this issue Oct 26, 2015 · 7 comments
Closed

API Docs: std::iter #29360

steveklabnik opened this issue Oct 26, 2015 · 7 comments

Comments

@steveklabnik
Copy link
Member

Part of #29329

http://doc.rust-lang.org/std/iter/

I've recently been doing a lot of work here, but it should be double checked.

@mdinger
Copy link
Contributor

mdinger commented Oct 26, 2015

This section being more filled out is really pretty nice. It's still missing the difference between these:

for i in vec { ... }

for i in &vec { ... }
for i in &*vec { ... }

for i in &mut vec { ... }
for i in &mut *vec { ... }

While the first case is covered, the 2nd and 4th aren't. The 3rd and 5th might not be necessary though they might be seen in the wild.

@steveklabnik
Copy link
Member Author

@steveklabnik
Copy link
Member Author

@mdinger that kind of thing really blelongs on Vec's page, I'd imagine, since that's an aspect of Vec and its implementations. They're all technically "covered", the desugaring is the same.

@mdinger
Copy link
Contributor

mdinger commented Nov 13, 2015

I didn't know the desugaring was the same. I thought one went to into_iter, one to iter and one to iter_mut because the syntax worked that way. Not because that's what the vec implementation does.

@steveklabnik
Copy link
Member Author

@mdinger
Copy link
Contributor

mdinger commented Nov 13, 2015

Ah okay. I didn't know it was always through into_iter. What you could do is use vec as an example and say is "Since vec implements these 3 cases of into_iter, we get to use these methods very conveniently. Any container who likewise implements them gets to utilize the same convenient form! All of the collections implement them (I'm not sure if they do but it sounds good)."

steveklabnik added a commit to steveklabnik/rust that referenced this issue Nov 17, 2015
And modifying IntoIterator for consisntency with it.

Part of rust-lang#29360
steveklabnik added a commit to steveklabnik/rust that referenced this issue Nov 17, 2015
…excrichton

And modifying IntoIterator for consisntency with it.

Part of rust-lang#29360
steveklabnik added a commit to steveklabnik/rust that referenced this issue Nov 17, 2015
And modifying IntoIterator for consisntency with it.

Part of rust-lang#29360
steveklabnik added a commit to steveklabnik/rust that referenced this issue Nov 17, 2015
…excrichton

And modifying IntoIterator for consisntency with it.

Part of rust-lang#29360
@steveklabnik
Copy link
Member Author

I am happy with this now.

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

No branches or pull requests

2 participants