From d7f5019b722b94f717e7ade281086577a86ad061 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Thu, 19 May 2022 12:38:18 +0200 Subject: [PATCH] Remove various `Sync` bounds With `Transport` becoming non-Clone and having `&mut` self receivers, the `Sync` requirement no longer makes any sense and we can thus remove it. --- core/src/transport.rs | 2 +- core/src/transport/boxed.rs | 4 ++-- core/src/transport/upgrade.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/transport.rs b/core/src/transport.rs index 2e39280b6aa..4b4ca825ec7 100644 --- a/core/src/transport.rs +++ b/core/src/transport.rs @@ -157,7 +157,7 @@ pub trait Transport { /// Boxes the transport, including custom transport errors. fn boxed(self) -> boxed::Boxed where - Self: Transport + Sized + Send + Sync + Unpin + 'static, + Self: Transport + Sized + Send + Unpin + 'static, Self::Dial: Send + 'static, Self::ListenerUpgrade: Send + 'static, Self::Error: Send + Sync, diff --git a/core/src/transport/boxed.rs b/core/src/transport/boxed.rs index 6ae4005972f..6e2ac4d27ee 100644 --- a/core/src/transport/boxed.rs +++ b/core/src/transport/boxed.rs @@ -31,7 +31,7 @@ use std::{ /// Creates a new [`Boxed`] transport from the given transport. pub fn boxed(transport: T) -> Boxed where - T: Transport + Send + Sync + Unpin + 'static, + T: Transport + Send + Unpin + 'static, T::Error: Send + Sync, T::Dial: Send + 'static, T::ListenerUpgrade: Send + 'static, @@ -45,7 +45,7 @@ where /// and `ListenerUpgrade` futures are `Box`ed and only the `Output` /// and `Error` types are captured in type variables. pub struct Boxed { - inner: Box + Send + Sync + Unpin>, + inner: Box + Send + Unpin>, } type Dial = Pin> + Send>>; diff --git a/core/src/transport/upgrade.rs b/core/src/transport/upgrade.rs index 689b584b631..338f8b92aed 100644 --- a/core/src/transport/upgrade.rs +++ b/core/src/transport/upgrade.rs @@ -295,7 +295,7 @@ impl Multiplexed { /// the [`StreamMuxer`] and custom transport errors. pub fn boxed(self) -> super::Boxed<(PeerId, StreamMuxerBox)> where - T: Transport + Sized + Send + Sync + Unpin + 'static, + T: Transport + Sized + Send + Unpin + 'static, T::Dial: Send + 'static, T::ListenerUpgrade: Send + 'static, T::Error: Send + Sync,