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.
This commit is contained in:
Thomas Eizinger 2022-05-29 20:42:48 +02:00 committed by GitHub
parent eba763443a
commit 4aa84bf7cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -152,7 +152,7 @@ pub trait Transport {
/// Boxes the transport, including custom transport errors.
fn boxed(self) -> boxed::Boxed<Self::Output>
where
Self: Transport + Sized + Send + Sync + 'static,
Self: Transport + Sized + Send + 'static,
Self::Dial: Send + 'static,
Self::Listener: Send + 'static,
Self::ListenerUpgrade: Send + 'static,

View File

@ -26,7 +26,7 @@ use std::{error::Error, fmt, io, pin::Pin};
/// Creates a new [`Boxed`] transport from the given transport.
pub fn boxed<T>(transport: T) -> Boxed<T::Output>
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<O> {
inner: Box<dyn Abstract<O> + Send + Sync>,
inner: Box<dyn Abstract<O> + Send>,
}
type Dial<O> = Pin<Box<dyn Future<Output = io::Result<O>> + Send>>;

View File

@ -294,7 +294,7 @@ impl<T> Multiplexed<T> {
/// the [`StreamMuxer`] and custom transport errors.
pub fn boxed<M>(self) -> super::Boxed<(PeerId, StreamMuxerBox)>
where
T: Transport<Output = (PeerId, M)> + Sized + Send + Sync + 'static,
T: Transport<Output = (PeerId, M)> + Sized + Send + 'static,
T::Dial: Send + 'static,
T::Listener: Send + 'static,
T::ListenerUpgrade: Send + 'static,