From 0ec3bbccb2eb8dc4c1db62db184e1358777942ae Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Mon, 25 Jul 2022 15:49:22 +0100 Subject: [PATCH] core/muxing: Remove `Unpin` requirement from `StreamMuxer::Substream` (#2776) --- core/CHANGELOG.md | 3 ++- core/src/muxing/boxed.rs | 4 ++-- core/src/transport/upgrade.rs | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/core/CHANGELOG.md b/core/CHANGELOG.md index 5098d45dd11..0fb742af96a 100644 --- a/core/CHANGELOG.md +++ b/core/CHANGELOG.md @@ -2,10 +2,11 @@ - Remove `StreamMuxer::poll_event` in favor of individual functions: `poll_inbound`, `poll_outbound` and `poll_address_change`. Consequently, `StreamMuxerEvent` is also removed. See [PR 2724]. -- Drop `Unpin` requirement from `SubstreamBox`. See [PR 2762]. +- Drop `Unpin` requirement from `SubstreamBox`. See [PR 2762] and [PR 2776]. [PR 2724]: https://github.com/libp2p/rust-libp2p/pull/2724 [PR 2762]: https://github.com/libp2p/rust-libp2p/pull/2762 +[PR 2776]: https://github.com/libp2p/rust-libp2p/pull/2776 # 0.34.0 diff --git a/core/src/muxing/boxed.rs b/core/src/muxing/boxed.rs index 259dfd01219..5dc98835866 100644 --- a/core/src/muxing/boxed.rs +++ b/core/src/muxing/boxed.rs @@ -29,7 +29,7 @@ where impl StreamMuxer for Wrap where T: StreamMuxer, - T::Substream: Send + Unpin + 'static, + T::Substream: Send + 'static, T::Error: Send + Sync + 'static, { type Substream = SubstreamBox; @@ -71,7 +71,7 @@ impl StreamMuxerBox { pub fn new(muxer: T) -> StreamMuxerBox where T: StreamMuxer + Send + Sync + 'static, - T::Substream: Send + Unpin + 'static, + T::Substream: Send + 'static, T::Error: Send + Sync + 'static, { let wrap = Wrap { inner: muxer }; diff --git a/core/src/transport/upgrade.rs b/core/src/transport/upgrade.rs index da87fb9dd6a..eb7b310c0a9 100644 --- a/core/src/transport/upgrade.rs +++ b/core/src/transport/upgrade.rs @@ -300,7 +300,7 @@ impl Multiplexed { T::ListenerUpgrade: Send + 'static, T::Error: Send + Sync, M: StreamMuxer + Send + Sync + 'static, - M::Substream: Send + Unpin + 'static, + M::Substream: Send + 'static, M::Error: Send + Sync + 'static, { boxed(self.map(|(i, m), _| (i, StreamMuxerBox::new(m))))