Skip to content

Commit 0080a0d

Browse files
committed
change expect to unwrap
1 parent 6c3f8af commit 0080a0d

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

src/stream/stream/fold.rs

+2-11
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,12 @@ where
4242
match next {
4343
Some(v) => {
4444
cx.waker().wake_by_ref();
45-
let old = self
46-
.as_mut()
47-
.acc()
48-
.take()
49-
.expect("FoldFuture should never contain None");
45+
let old = self.as_mut().acc().take().unwrap();
5046
let new = (self.as_mut().f())(old, v);
5147
*self.as_mut().acc() = Some(new);
5248
Poll::Pending
5349
}
54-
None => Poll::Ready(
55-
self.as_mut()
56-
.acc()
57-
.take()
58-
.expect("FoldFuture should never contain None"),
59-
),
50+
None => Poll::Ready(self.as_mut().acc().take().unwrap()),
6051
}
6152
}
6253
}

0 commit comments

Comments
 (0)