-
Notifications
You must be signed in to change notification settings - Fork 507
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
420 document parallel iterator methods #511
420 document parallel iterator methods #511
Conversation
src/iter/mod.rs
Outdated
/// | ||
/// let (sender, receiver) = channel(); | ||
/// | ||
/// let mut par_iter = (0..5).into_par_iter().map_with(sender, |s, x| { s.send(x).unwrap(); x }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: can we format this a bit more clearly? Maybe run the example through rustfmt (on play) and paste it back? I feel like it's a bit hard to follow what's happening. (Also, some comments explaining what's going on wouldn't hurt.)
/// use rayon::prelude::*; | ||
/// let sums = [(0, 1), (5, 6), (16, 2), (8, 9)] | ||
/// .par_iter() // iterating over &(i32, i32) | ||
/// .cloned() // iterating over (i32, i32) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formatting like this is great =)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This is great. I left a few nits, just formatting of the example code.
@nikomatsakis Thanks for your review. |
bors r+ |
Build failed |
bors r=nikomatsakis |
Contribution for closing #420.
There is one method left in the
ParallelIterator
trait that has no example:opt_len
.Also the example for
fold_with
might not be necessary.