mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-23 23:01:33 +00:00
Minor opti poll Fuse (#946)
This commit is contained in:
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user