-
Notifications
You must be signed in to change notification settings - Fork 508
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
Conversation
/// } | ||
/// | ||
/// let bh: BlackHole = (0i32..1000).into_par_iter().collect(); | ||
/// assert_eq!(bh.mass, 4000); |
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.
cute
@@ -1671,6 +1716,33 @@ pub trait IndexedParallelIterator: ParallelIterator { | |||
/// | |||
/// [`ParallelIterator`]: trait.ParallelIterator.html | |||
/// [`collect()`]: trait.ParallelIterator.html#method.collect | |||
/// | |||
/// # Examples |
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.
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.
bors r+ |
This covers the simpler one-method traits for #420.