Minor opti poll Fuse (#946)

This commit is contained in:
Pierre Krieger
2019-02-18 11:24:01 +01:00
committed by GitHub
parent 965c154093
commit 2d31c2f733

View File

@ -146,16 +146,15 @@ where
ProtocolsHandlerEvent<Self::OutboundProtocol, Self::OutboundOpenInfo, Self::OutEvent>, ProtocolsHandlerEvent<Self::OutboundProtocol, Self::OutboundOpenInfo, Self::OutEvent>,
Self::Error, Self::Error,
> { > {
if let Some(mut inner) = self.inner.take() { let poll = match self.inner.as_mut() {
let poll = inner.poll(); Some(i) => i.poll(),
if let Ok(Async::Ready(ProtocolsHandlerEvent::Shutdown)) = poll { None => return Ok(Async::Ready(ProtocolsHandlerEvent::Shutdown)),
poll };
} else {
self.inner = Some(inner); if let Ok(Async::Ready(ProtocolsHandlerEvent::Shutdown)) = poll {
poll self.inner = None;
}
} else {
Ok(Async::Ready(ProtocolsHandlerEvent::Shutdown))
} }
poll
} }
} }