diff --git a/core/src/muxing/boxed.rs b/core/src/muxing/boxed.rs index 3547183d657..aa703af89b4 100644 --- a/core/src/muxing/boxed.rs +++ b/core/src/muxing/boxed.rs @@ -50,16 +50,10 @@ where &self, cx: &mut Context<'_>, ) -> Poll, 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]