2
0
Fork 1
mirror of https://github.com/async-rs/async-std.git synced 2025-02-28 23:29:41 +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 {
Some(v) => {
cx.waker().wake_by_ref();
let old = self
.as_mut()
.acc()
.take()
.expect("FoldFuture should never contain None");
let old = self.as_mut().acc().take().unwrap();
let new = (self.as_mut().f())(old, v);
*self.as_mut().acc() = Some(new);
Poll::Pending
}
None => Poll::Ready(
self.as_mut()
.acc()
.take()
.expect("FoldFuture should never contain None"),
),
None => Poll::Ready(self.as_mut().acc().take().unwrap()),
}
}
}