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

420 document parallel iterator methods #511

Merged
merged 5 commits into from
Feb 7, 2018
Merged

420 document parallel iterator methods #511

merged 5 commits into from
Feb 7, 2018

Conversation

oddg
Copy link
Contributor

@oddg oddg commented Jan 20, 2018

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.

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 });
Copy link
Member

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)
Copy link
Member

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 =)

Copy link
Member

@nikomatsakis nikomatsakis left a 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.

@oddg
Copy link
Contributor Author

oddg commented Jan 24, 2018

@nikomatsakis Thanks for your review.
I hope the example is clearer now.

@nikomatsakis
Copy link
Member

bors r+

bors bot added a commit that referenced this pull request Feb 6, 2018
511: 420 document parallel iterator methods r=nikomatsakis a=oddg

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.
@bors
Copy link
Contributor

bors bot commented Feb 6, 2018

Build failed

@cuviper
Copy link
Member

cuviper commented Feb 7, 2018

bors r=nikomatsakis

bors bot added a commit that referenced this pull request Feb 7, 2018
511: 420 document parallel iterator methods r=nikomatsakis a=oddg

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.
@bors
Copy link
Contributor

bors bot commented Feb 7, 2018

@bors bors bot merged commit 8936322 into rayon-rs:master Feb 7, 2018
@oddg oddg deleted the 420-document-parallel-iterator-methods branch February 7, 2018 05:13
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 this pull request may close these issues.

3 participants