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:
parent
6c3f8af62d
commit
0080a0da8c
1 changed files with 2 additions and 11 deletions
|
@ -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()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue