From 560cf4c9496142339e284406cdfc41411e1a81fb Mon Sep 17 00:00:00 2001 From: al8n Date: Mon, 23 Dec 2024 11:00:30 +0800 Subject: [PATCH] relax-trait-bounds --- core/src/state.rs | 2 -- core/src/suspicion.rs | 3 --- core/src/transport.rs | 2 +- core/src/transport/lpe.rs | 6 ++---- types/src/message.rs | 6 ++---- 5 files changed, 5 insertions(+), 14 deletions(-) diff --git a/core/src/state.rs b/core/src/state.rs index 7e86233..265f0d9 100644 --- a/core/src/state.rs +++ b/core/src/state.rs @@ -136,7 +136,6 @@ impl Memberlist where D: Delegate::ResolvedAddress>, T: Transport, - T::Id: Send + Sync + 'static, { /// Does a complete state exchange with a specific node. pub(crate) async fn push_pull_node( @@ -578,7 +577,6 @@ enum StateMessage { impl StateMessage where T: Transport, - T::Id: Send + Sync + 'static, { async fn run(self, s: &Memberlist) where diff --git a/core/src/suspicion.rs b/core/src/suspicion.rs index 82b2462..023506c 100644 --- a/core/src/suspicion.rs +++ b/core/src/suspicion.rs @@ -46,7 +46,6 @@ where impl Suspicioner where T: Transport, - T::Id: Send + Sync + 'static, D: Delegate::ResolvedAddress>, { pub(crate) fn new( @@ -138,7 +137,6 @@ where impl Suspicion where T: Transport, - T::Id: Send + Sync + 'static, D: Delegate::ResolvedAddress>, { /// Returns a after_func started with the max time, and that will drive @@ -180,7 +178,6 @@ where impl Suspicion where T: Transport, - T::Id: Send + Sync + 'static, D: Delegate::ResolvedAddress>, { /// Confirm registers that a possibly new peer has also determined the given diff --git a/core/src/transport.rs b/core/src/transport.rs index 801bdcf..a851052 100644 --- a/core/src/transport.rs +++ b/core/src/transport.rs @@ -273,7 +273,7 @@ pub trait Transport: Sized + Send + Sync + 'static { /// The error type for the transport type Error: TransportError; /// The id type used to identify nodes - type Id: Id + Send + Sync + 'static; + type Id: Id; /// The address resolver used to resolve addresses type Resolver: AddressResolver; /// The promised stream used to send and receive messages diff --git a/core/src/transport/lpe.rs b/core/src/transport/lpe.rs index 7f328e6..31a9827 100644 --- a/core/src/transport/lpe.rs +++ b/core/src/transport/lpe.rs @@ -47,10 +47,8 @@ impl core::fmt::Display for Lpe { impl Wire for Lpe where - I: Transformable + core::fmt::Debug + Send + Sync + 'static, - I::Error: Send + Sync + 'static, - A: Transformable + core::fmt::Debug + Send + Sync + 'static, - A::Error: Send + Sync + 'static, + I: Transformable + core::fmt::Debug, + A: Transformable + core::fmt::Debug, { type Error = MessageTransformError; type Id = I; diff --git a/types/src/message.rs b/types/src/message.rs index 73c3bbf..631ab81 100644 --- a/types/src/message.rs +++ b/types/src/message.rs @@ -186,10 +186,8 @@ const INLINED_BYTES_SIZE: usize = 64; impl Transformable for Message where - I: Transformable + core::fmt::Debug + 'static, - I::Error: Send + Sync + 'static, - A: Transformable + core::fmt::Debug + 'static, - A::Error: Send + Sync + 'static, + I: Transformable + core::fmt::Debug, + A: Transformable + core::fmt::Debug, { type Error = MessageTransformError;