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