From 168f3df057f9d836b1637023cd8a4ed942dffe8e Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Mon, 17 Oct 2022 09:46:25 +1100 Subject: [PATCH 1/2] Remove deprecated functions --- core/CHANGELOG.md | 6 ++++++ core/src/muxing.rs | 44 -------------------------------------------- 2 files changed, 6 insertions(+), 44 deletions(-) diff --git a/core/CHANGELOG.md b/core/CHANGELOG.md index e996824209c..ac4b87ebd2d 100644 --- a/core/CHANGELOG.md +++ b/core/CHANGELOG.md @@ -1,3 +1,9 @@ +# 0.38.0 [unreleased] + +- Remove deprecated functions `StreamMuxerExt::next_{inbound,outbound}`. See [PR XXXX]. + +[PR XXXX]: https://github.com/libp2p/rust-libp2p/pull/XXXX + # 0.37.0 - Implement `Hash` and `Ord` for `PublicKey`. See [PR 2915]. diff --git a/core/src/muxing.rs b/core/src/muxing.rs index 8d6f62fc022..cb3f79e69d5 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, From 0c94c88191eb4c3502f168ffafb24431f6b70cc9 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Mon, 17 Oct 2022 09:47:38 +1100 Subject: [PATCH 2/2] Update core/CHANGELOG.md --- core/CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/CHANGELOG.md b/core/CHANGELOG.md index ac4b87ebd2d..d1dd0706c11 100644 --- a/core/CHANGELOG.md +++ b/core/CHANGELOG.md @@ -1,8 +1,8 @@ # 0.38.0 [unreleased] -- Remove deprecated functions `StreamMuxerExt::next_{inbound,outbound}`. See [PR XXXX]. +- Remove deprecated functions `StreamMuxerExt::next_{inbound,outbound}`. See [PR 3031]. -[PR XXXX]: https://github.com/libp2p/rust-libp2p/pull/XXXX +[PR 3031]: https://github.com/libp2p/rust-libp2p/pull/3031 # 0.37.0