We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 127b244 commit dc00793Copy full SHA for dc00793
futures-util/src/future/lazy.rs
@@ -49,6 +49,6 @@ impl<F, R> Future for Lazy<F>
49
type Output = R;
50
51
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<R> {
52
- Poll::Ready((self.f.take().unwrap())(cx))
+ Poll::Ready((self.f.take().expect("Lazy polled after completion"))(cx))
53
}
54
futures-util/src/future/ready.rs
@@ -28,7 +28,7 @@ impl<T> Future for Ready<T> {
28
29
#[inline]
30
fn poll(mut self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<T> {
31
- Poll::Ready(self.0.take().unwrap())
+ Poll::Ready(self.0.take().expect("Ready polled after completion"))
32
33
34
0 commit comments