Skip to content

Commit

Permalink
Note partition's ability to use distinct types
Browse files Browse the repository at this point in the history
  • Loading branch information
cuviper committed May 1, 2017
1 parent 4581a9a commit de19391
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/iter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,11 @@ pub trait ParallelIterator: Sized {
/// Partitions the items of a parallel iterator into a pair of arbitrary
/// `ParallelExtend` containers. Items for which the `predicate` returns
/// true go into the first container, and the rest go into the second.
///
/// Note: unlike the standard `Iterator::partition`, this allows distinct
/// collection types for the left and right items. This is more flexible,
/// but may require new type annotations when converting sequential code
/// that used type inferrence assuming the two were the same.
fn partition<A, B, P>(self, predicate: P) -> (A, B)
where A: Default + ParallelExtend<Self::Item>,
B: Default + ParallelExtend<Self::Item>,
Expand Down

0 comments on commit de19391

Please sign in to comment.