Skip to content

Commit

Permalink
Use map_inbound_stream helper
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaseizinger committed Jun 20, 2022
1 parent 27638ac commit 758800c
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions core/src/muxing/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,10 @@ where
&self,
cx: &mut Context<'_>,
) -> Poll<Result<StreamMuxerEvent<Self::Substream>, Self::Error>> {
let event = ready!(self.inner.poll_event(cx).map_err(into_io_error)?);

match event {
StreamMuxerEvent::AddressChange(a) => {
Poll::Ready(Ok(StreamMuxerEvent::AddressChange(a)))
}
StreamMuxerEvent::InboundSubstream(s) => {
Poll::Ready(Ok(StreamMuxerEvent::InboundSubstream(SubstreamBox::new(s))))
}
}
let event = ready!(self.inner.poll_event(cx).map_err(into_io_error)?)
.map_inbound_stream(SubstreamBox::new);

Poll::Ready(Ok(event))
}

#[inline]
Expand Down

0 comments on commit 758800c

Please sign in to comment.