2
0
Fork 1
mirror of https://github.com/async-rs/async-std.git synced 2025-04-23 08:46:46 +00:00

change expect to unwrap

This commit is contained in:
Fedor Sakharov 2019-09-12 18:15:20 +03:00
parent 6c3f8af62d
commit 0080a0da8c
No known key found for this signature in database
GPG key ID: 93D436E666BF0FEE

View file

@ -42,21 +42,12 @@ where
match next { match next {
Some(v) => { Some(v) => {
cx.waker().wake_by_ref(); cx.waker().wake_by_ref();
let old = self let old = self.as_mut().acc().take().unwrap();
.as_mut()
.acc()
.take()
.expect("FoldFuture should never contain None");
let new = (self.as_mut().f())(old, v); let new = (self.as_mut().f())(old, v);
*self.as_mut().acc() = Some(new); *self.as_mut().acc() = Some(new);
Poll::Pending Poll::Pending
} }
None => Poll::Ready( None => Poll::Ready(self.as_mut().acc().take().unwrap()),
self.as_mut()
.acc()
.take()
.expect("FoldFuture should never contain None"),
),
} }
} }
} }