From df659e5bcdb5c59005369fb426caba05109c74f8 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Thu, 3 Nov 2022 02:09:12 +1100 Subject: [PATCH] core/muxer: Remove deprecated functions (#3031) --- core/CHANGELOG.md | 3 +++ core/src/muxing.rs | 44 -------------------------------------------- 2 files changed, 3 insertions(+), 44 deletions(-) diff --git a/core/CHANGELOG.md b/core/CHANGELOG.md index c4a57cb6..d7059cab 100644 --- a/core/CHANGELOG.md +++ b/core/CHANGELOG.md @@ -1,7 +1,10 @@ # 0.38.0 [unreleased] +- Remove deprecated functions `StreamMuxerExt::next_{inbound,outbound}`. See [PR 3031]. + - Hide `prost::Error` from public API in `FromEnvelopeError::InvalidPeerRecord` and `signed_envelope::DecodingError`. See [PR 3058]. +[PR 3031]: https://github.com/libp2p/rust-libp2p/pull/3031 [PR 3058]: https://github.com/libp2p/rust-libp2p/pull/3058 # 0.37.0 diff --git a/core/src/muxing.rs b/core/src/muxing.rs index 8d6f62fc..cb3f79e6 100644 --- a/core/src/muxing.rs +++ b/core/src/muxing.rs @@ -159,24 +159,6 @@ pub trait StreamMuxerExt: StreamMuxer + Sized { Pin::new(self).poll_close(cx) } - /// Returns a future that resolves to the next inbound `Substream` opened by the remote. - #[deprecated( - since = "0.37.0", - note = "This future violates the `StreamMuxer` contract because it doesn't call `StreamMuxer::poll`." - )] - fn next_inbound(&mut self) -> NextInbound<'_, Self> { - NextInbound(self) - } - - /// Returns a future that opens a new outbound `Substream` with the remote. - #[deprecated( - since = "0.37.0", - note = "This future violates the `StreamMuxer` contract because it doesn't call `StreamMuxer::poll`." - )] - fn next_outbound(&mut self) -> NextOutbound<'_, Self> { - NextOutbound(self) - } - /// Returns a future for closing this [`StreamMuxer`]. fn close(self) -> Close { Close(self) @@ -185,34 +167,8 @@ pub trait StreamMuxerExt: StreamMuxer + Sized { impl StreamMuxerExt for S where S: StreamMuxer {} -pub struct NextInbound<'a, S>(&'a mut S); - -pub struct NextOutbound<'a, S>(&'a mut S); - pub struct Close(S); -impl<'a, S> Future for NextInbound<'a, S> -where - S: StreamMuxer + Unpin, -{ - type Output = Result; - - fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { - self.0.poll_inbound_unpin(cx) - } -} - -impl<'a, S> Future for NextOutbound<'a, S> -where - S: StreamMuxer + Unpin, -{ - type Output = Result; - - fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { - self.0.poll_outbound_unpin(cx) - } -} - impl Future for Close where S: StreamMuxer + Unpin,