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 a examples to the module docs #411
Conversation
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
Ah, I did not know that. I added a note to the docs. |
dns2utf8
referenced this pull request
Sep 6, 2017
Closed
Raise the min version requirement because of the `?` operator #412
This comment has been minimized.
This comment has been minimized.
|
I cherry-picked your CI fixes in #436. If you'll please rebase the rest of your changes, we can see how CI fares now. |
dns2utf8
force-pushed the
dns2utf8:doc_ranges
branch
from
7026b02
to
286f82f
Sep 22, 2017
This comment has been minimized.
This comment has been minimized.
|
Rebased and tested. Thank you for the cerry-picking. |
cuviper
requested changes
Sep 22, 2017
| //! | ||
| //! let r = (0..100u64).into_par_iter() | ||
| //! .fold(|| 0, |acc, cur| acc + cur) | ||
| //! .sum(); |
This comment has been minimized.
This comment has been minimized.
cuviper
Sep 22, 2017
Member
I notice in both examples you use .fold(...).sum(), when just .sum() should work fine. Was this intentional?
|
|
||
| use iter::*; | ||
| use iter::internal::*; | ||
| use std::ops::Range; | ||
|
|
||
| /// Parallel iterator over a range | ||
| /// Implemented for `u32`, `i32`, `usize` and `isize`. |
This comment has been minimized.
This comment has been minimized.
cuviper
Sep 22, 2017
Member
We should have a blank doc-line between the intro and additional description. Or if you want it as one intro paragraph, then it needs punctuation between the clauses.
Also, ParallelIterator is implemented for range::Iter<T> of all integer types. The difference is just that i64 and u64 don't implement IndexedParallelIterator, which you'd need for zip, for example.
dns2utf8
force-pushed the
dns2utf8:doc_ranges
branch
from
7b7560b
to
a7a1e6a
Sep 25, 2017
This comment has been minimized.
This comment has been minimized.
|
Hm the |
This comment has been minimized.
This comment has been minimized.
|
Would you like me to squash the commits? |
dns2utf8
force-pushed the
dns2utf8:doc_ranges
branch
from
a7a1e6a
to
8f5464e
Sep 25, 2017
cuviper
reviewed
Sep 26, 2017
| @@ -781,6 +781,8 @@ impl<T: ParallelIterator> IntoParallelIterator for T { | |||
| /// An iterator that supports "random access" to its data, meaning | |||
| /// that you can split it at arbitrary indices and draw data from | |||
| /// those points. | |||
| /// | |||
| /// **Note:** Not implemented for `u64` and `i64` | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Yeah, let's squash this one to its final state, thanks! |
dns2utf8
force-pushed the
dns2utf8:doc_ranges
branch
from
8f5464e
to
12a7fd8
Oct 2, 2017
dns2utf8
force-pushed the
dns2utf8:doc_ranges
branch
from
12a7fd8
to
6ae6240
Oct 2, 2017
This comment has been minimized.
This comment has been minimized.
|
Fixed and squashed. Greetings from the RustFest impl days |
cuviper
approved these changes
Oct 2, 2017
cuviper
merged commit e8c0212
into
rayon-rs:master
Oct 2, 2017
This comment has been minimized.
This comment has been minimized.
|
Thanks! |
dns2utf8 commentedSep 5, 2017
Hi
I wanted to add examples to the docs. My first example works as I expected.
My second example behaves very strange. It compiles when I use
i32as the type of theRange<T>.With any other type such as
usize,u64ori64it does not compile.Do you have an idea how to fix it?
Regards
Error message: