From 4aa84bf7cd78c8553294f4f352fce9e20b6fbd4e Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Sun, 29 May 2022 20:42:48 +0200 Subject: [PATCH] core/transport: Remove `Sync` bounds (#2667) 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 ce64f2dd923..a625e3b552c 100644 --- a/core/src/transport.rs +++ b/core/src/transport.rs @@ -152,7 +152,7 @@ pub trait Transport { /// Boxes the transport, including custom transport errors. fn boxed(self) -> boxed::Boxed where - Self: Transport + Sized + Send + Sync + 'static, + Self: Transport + Sized + Send + 'static, Self::Dial: Send + 'static, Self::Listener: Send + 'static, Self::ListenerUpgrade: Send + 'static, diff --git a/core/src/transport/boxed.rs b/core/src/transport/boxed.rs index 6ddf34ad950..8a804aa40be 100644 --- a/core/src/transport/boxed.rs +++ b/core/src/transport/boxed.rs @@ -26,7 +26,7 @@ use std::{error::Error, fmt, io, pin::Pin}; /// Creates a new [`Boxed`] transport from the given transport. pub fn boxed(transport: T) -> Boxed where - T: Transport + Send + Sync + 'static, + T: Transport + Send + 'static, T::Error: Send + Sync, T::Dial: Send + 'static, T::Listener: Send + 'static, @@ -41,7 +41,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>, + inner: Box + Send>, } type Dial = Pin> + Send>>; diff --git a/core/src/transport/upgrade.rs b/core/src/transport/upgrade.rs index c72859eb57d..5508429754f 100644 --- a/core/src/transport/upgrade.rs +++ b/core/src/transport/upgrade.rs @@ -294,7 +294,7 @@ impl Multiplexed { /// the [`StreamMuxer`] and custom transport errors. pub fn boxed(self) -> super::Boxed<(PeerId, StreamMuxerBox)> where - T: Transport + Sized + Send + Sync + 'static, + T: Transport + Sized + Send + 'static, T::Dial: Send + 'static, T::Listener: Send + 'static, T::ListenerUpgrade: Send + 'static,