diff --git a/src/future.rs b/src/future.rs index 01f05ce..f88fde7 100644 --- a/src/future.rs +++ b/src/future.rs @@ -496,16 +496,14 @@ impl Future for Fuse { type Output = Fut::Output; fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { - self.as_mut() - .project() - .inner - .as_pin_mut() - .map(|f| f.poll(cx)) - .unwrap_or(Poll::Pending) - .map(|output| { + match self.as_mut().project().inner.as_pin_mut().map(|f| f.poll(cx)) { + Some(Poll::Ready(output)) => { self.project().inner.set(None); - output - }) + Poll::Ready(output) + } + + Some(Poll::Pending) | None => Poll::Pending + } } }