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

Doc suggestion: show output for next_back() example #34065

Closed
xpe opened this issue Jun 3, 2016 · 4 comments
Closed

Doc suggestion: show output for next_back() example #34065

xpe opened this issue Jun 3, 2016 · 4 comments
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-help-wanted Call for participation: Help is requested to fix this issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.

Comments

@xpe
Copy link

xpe commented Jun 3, 2016

For me, at least, the example using next() and next_back() tells the story better if it shows the output.

I'm reading about the DoubleEndedIterator

Thanks to mbrubeck on #rust-beginners for these examples:

let mut iter = vec![1,2,3,4,5].into_iter(); (iter.next(), iter.next_back())
(Some(1), Some(5))
let mut i = vec![1,2,3,4,5].into_iter(); (i.next(), i.next_back(), i.next(), i.next_back())
(Some(1), Some(5), Some(2), Some(4))

I plan to come back to this issue and submit a proper documentation patch.

@GuillaumeGomez
Copy link
Member

Nice idea!

@steveklabnik steveklabnik added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. E-help-wanted Call for participation: Help is requested to fix this issue. labels Jun 27, 2016
@steveklabnik
Copy link
Member

I would be happy to work with anyone who wants to work on this issue.

@GuillaumeGomez
Copy link
Member

If no one does it, I can but I think it could be a nice first contribution.

@steveklabnik
Copy link
Member

@xpe So, looking at this again, what is the issue here? I'm not sure what's significantly different here.

Manishearth added a commit to Manishearth/rust that referenced this issue Jul 8, 2016
…r, r=steveklabnik

Improve DoubleEndedIterator examples

Fixes rust-lang#34065.

r? @steveklabnik
Manishearth added a commit to Manishearth/rust that referenced this issue Jul 8, 2016
…r, r=steveklabnik

Improve DoubleEndedIterator examples

Fixes rust-lang#34065.

r? @steveklabnik
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-help-wanted Call for participation: Help is requested to fix this issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
Projects
None yet
Development

No branches or pull requests

3 participants