Skip to content

Commit

Permalink
Merge #683
Browse files Browse the repository at this point in the history
683: impl ParallelExtend<()> for () r=cuviper a=cuviper

Mirrors rust-lang/rust#50234

Co-authored-by: Josh Stone <cuviper@gmail.com>
  • Loading branch information
bors[bot] and cuviper committed Aug 22, 2019
2 parents 2720d8d + c6a294b commit d993d7a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/iter/extend.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use super::noop::NoopConsumer;
use super::{IntoParallelIterator, ParallelExtend, ParallelIterator};

use std::borrow::Cow;
Expand Down Expand Up @@ -368,3 +369,13 @@ where
self.par_extend(par_iter.into_par_iter().cloned())
}
}

/// Collapses all unit items from a parallel iterator into one.
impl ParallelExtend<()> for () {
fn par_extend<I>(&mut self, par_iter: I)
where
I: IntoParallelIterator<Item = ()>,
{
par_iter.into_par_iter().drive_unindexed(NoopConsumer)
}
}

0 comments on commit d993d7a

Please sign in to comment.