Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd documentation examples for parallel iterator methods #466
Conversation
lnicola
suggested changes
Oct 29, 2017
src/iter/mod.rs
Outdated
| /// ``` | ||
| /// use rayon::prelude::*; | ||
| /// let a = [-3_i32, 77, 53, 240, -1]; | ||
| /// assert_eq!(*a.par_iter().min_by(|x, y| x.cmp(y)).unwrap(), -3); |
This comment has been minimized.
This comment has been minimized.
src/iter/mod.rs
Outdated
| /// ``` | ||
| /// use rayon::prelude::*; | ||
| /// let a = [-3_i32, 34, 2, 5, -10, -3, -23]; | ||
| /// assert_eq!(*a.par_iter().min_by_key(|x| x.abs()).unwrap(), 2); |
This comment has been minimized.
This comment has been minimized.
src/iter/mod.rs
Outdated
| /// ``` | ||
| /// use rayon::prelude::*; | ||
| /// let a = [-3_i32, 77, 53, 240, -1]; | ||
| /// assert_eq!(*a.iter().max_by(|x, y| x.cmp(y)).unwrap(), 240); |
This comment has been minimized.
This comment has been minimized.
src/iter/mod.rs
Outdated
| /// ``` | ||
| /// use rayon::prelude::*; | ||
| /// let a = [-3_i32, 34, 2, 5, -10, -3, -23]; | ||
| /// assert_eq!(*a.par_iter().max_by_key(|x| x.abs()).unwrap(), 34); |
This comment has been minimized.
This comment has been minimized.
src/iter/mod.rs
Outdated
| /// let a = [43, 77, 32]; | ||
| /// assert_eq!(a.par_iter().count(), 3); | ||
| /// | ||
| /// let a = [43, 77, 32, 39]; |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
src/iter/mod.rs
Outdated
| /// ``` | ||
| /// use rayon::prelude::*; | ||
| /// let a = [45, 74, 32]; | ||
| /// let b: Vec<u32> = Vec::new(); |
This comment has been minimized.
This comment has been minimized.
src/iter/mod.rs
Outdated
| /// ``` | ||
| /// use rayon::prelude::*; | ||
| /// let a = [45, 74, 32]; | ||
| /// let b: Vec<u32> = Vec::new(); |
This comment has been minimized.
This comment has been minimized.
lnicola
reviewed
Oct 29, 2017
src/iter/mod.rs
Outdated
| /// use std::sync::mpsc::channel; | ||
| /// use rayon::prelude::*; | ||
| /// let (tx, rx) = channel(); | ||
| /// (0..5).map(|x| x * 2 + 1).par_iter() |
This comment has been minimized.
This comment has been minimized.
lnicola
Oct 29, 2017
(0..5).into_par_iter().map(...). Right now there's no way to obtain a ParallelIterator from a general Iterator like map returns.
This comment has been minimized.
This comment has been minimized.
|
Thanks for the detailed review, @lnicola! @mamuleanu will you be able to address this feedback? At a minimum, we need to get a clean CI build. |
This comment has been minimized.
This comment has been minimized.
mamuleanu
force-pushed the
mamuleanu:docs-updates
branch
from
557f2c9
to
913d358
Nov 4, 2017
cuviper
added some commits
Nov 6, 2017
cuviper
changed the title
[WIP] Add documentation examples for parallel iterator methods
Add documentation examples for parallel iterator methods
Nov 6, 2017
This comment has been minimized.
This comment has been minimized.
|
I made a few small tweaks. Let's see if the bot likes it: bors r+ |
bors bot
added a commit
that referenced
this pull request
Nov 6, 2017
This comment has been minimized.
This comment has been minimized.
lnicola
commented
Nov 6, 2017
This comment has been minimized.
This comment has been minimized.
|
Hmm, that's true, it's not quite complete. I think I'll just reopen after, instead of bothering bors about this. |
cuviper
referenced this pull request
Nov 6, 2017
Merged
Add examples to the ParallelIterator documentation #467
This comment has been minimized.
This comment has been minimized.
bors
bot
merged commit 2d3c873
into
rayon-rs:master
Nov 7, 2017
2 checks passed
bors
Build succeeded
continuous-integration/travis-ci/pr
The Travis CI build passed
Details
cuviper
referenced this pull request
Nov 7, 2017
Closed
doc: Documentation examples for parallel iterator methods #420
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
mamuleanu commentedOct 29, 2017
Closes #420