Skip to content

Commit bcfca1b

Browse files
committed
Clean up PanicFuse for 1.26
1 parent c149e96 commit bcfca1b

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/iter/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1761,7 +1761,7 @@ pub trait ParallelIterator: Sized + Send {
17611761
/// });
17621762
/// ```
17631763
fn panic_fuse(self) -> PanicFuse<Self> {
1764-
panic_fuse::new(self)
1764+
PanicFuse::new(self)
17651765
}
17661766

17671767
/// Create a fresh collection containing all the element produced

src/iter/panic_fuse.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ impl<'a> Fuse<'a> {
3636
}
3737
}
3838

39-
/// Create a new `PanicFuse` iterator.
40-
///
41-
/// NB: a free fn because it is NOT part of the end-user API.
42-
pub fn new<I>(base: I) -> PanicFuse<I>
39+
impl<I> PanicFuse<I>
4340
where
4441
I: ParallelIterator,
4542
{
46-
PanicFuse { base: base }
43+
/// Create a new `PanicFuse` iterator.
44+
pub(super) fn new(base: I) -> PanicFuse<I> {
45+
PanicFuse { base }
46+
}
4747
}
4848

4949
impl<I> ParallelIterator for PanicFuse<I>
@@ -93,7 +93,7 @@ where
9393
where
9494
CB: ProducerCallback<Self::Item>,
9595
{
96-
return self.base.with_producer(Callback { callback: callback });
96+
return self.base.with_producer(Callback { callback });
9797

9898
struct Callback<CB> {
9999
callback: CB,
@@ -111,7 +111,7 @@ where
111111
{
112112
let panicked = AtomicBool::new(false);
113113
let producer = PanicFuseProducer {
114-
base: base,
114+
base,
115115
fuse: Fuse(&panicked),
116116
};
117117
self.callback.callback(producer)

0 commit comments

Comments
 (0)