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

Add examples to more traits #526

Merged
merged 5 commits into from
Feb 8, 2018
Merged

Add examples to more traits #526

merged 5 commits into from
Feb 8, 2018

Conversation

cuviper
Copy link
Member

@cuviper cuviper commented Feb 7, 2018

This covers the simpler one-method traits for #420.

/// }
///
/// let bh: BlackHole = (0i32..1000).into_par_iter().collect();
/// assert_eq!(bh.mass, 4000);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cute

@@ -1671,6 +1716,33 @@ pub trait IndexedParallelIterator: ParallelIterator {
///
/// [`ParallelIterator`]: trait.ParallelIterator.html
/// [`collect()`]: trait.ParallelIterator.html#method.collect
///
/// # Examples
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fwiw I often think that the idiomatic style for iterators out to be from_iter (and hence from_par_iter). I like that writing

let x =
    BlackHole::from_par_iter(...);

kind of "automatically" gives the needed type-annotation. But oh well.

@nikomatsakis
Copy link
Member

bors r+

bors bot added a commit that referenced this pull request Feb 8, 2018
526: Add examples to more traits r=nikomatsakis a=cuviper

This covers the simpler one-method traits for #420.
@bors
Copy link
Contributor

bors bot commented Feb 8, 2018

@bors bors bot merged commit 8363cf0 into rayon-rs:master Feb 8, 2018
@cuviper cuviper deleted the examples branch October 18, 2018 19: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.

2 participants