Skip to content

Commit

Permalink
Clean up PanicFuse for 1.26
Browse files Browse the repository at this point in the history
  • Loading branch information
cuviper committed May 8, 2019
1 parent c149e96 commit bcfca1b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/iter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1761,7 +1761,7 @@ pub trait ParallelIterator: Sized + Send {
/// });
/// ```
fn panic_fuse(self) -> PanicFuse<Self> {
panic_fuse::new(self)
PanicFuse::new(self)
}

/// Create a fresh collection containing all the element produced
Expand Down
14 changes: 7 additions & 7 deletions src/iter/panic_fuse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ impl<'a> Fuse<'a> {
}
}

/// Create a new `PanicFuse` iterator.
///
/// NB: a free fn because it is NOT part of the end-user API.
pub fn new<I>(base: I) -> PanicFuse<I>
impl<I> PanicFuse<I>
where
I: ParallelIterator,
{
PanicFuse { base: base }
/// Create a new `PanicFuse` iterator.
pub(super) fn new(base: I) -> PanicFuse<I> {
PanicFuse { base }
}
}

impl<I> ParallelIterator for PanicFuse<I>
Expand Down Expand Up @@ -93,7 +93,7 @@ where
where
CB: ProducerCallback<Self::Item>,
{
return self.base.with_producer(Callback { callback: callback });
return self.base.with_producer(Callback { callback });

struct Callback<CB> {
callback: CB,
Expand All @@ -111,7 +111,7 @@ where
{
let panicked = AtomicBool::new(false);
let producer = PanicFuseProducer {
base: base,
base,
fuse: Fuse(&panicked),
};
self.callback.callback(producer)
Expand Down

0 comments on commit bcfca1b

Please sign in to comment.