Skip to content

Commit ae66f7f

Browse files
committed
Refactor: remove OptionalBound from T
1 parent c8a50e9 commit ae66f7f

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

openraft/src/type_config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ pub trait RaftTypeConfig:
7272
/// See the [storage chapter of the guide][sto] for details on log compaction / snapshotting.
7373
///
7474
/// [sto]: crate::docs::getting_started#3-implement-raftlogstorage-and-raftstatemachine
75-
type SnapshotData: OptionalSend + OptionalSync + 'static;
75+
type SnapshotData: OptionalSend + 'static;
7676

7777
/// Asynchronous runtime type.
7878
type AsyncRuntime: AsyncRuntime;

openraft/src/type_config/async_runtime/impls/tokio_runtime.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ impl AsyncRuntime for TokioRuntime {
7777
type MpscUnbounded = TokioMpscUnbounded;
7878
type Watch = TokioWatch;
7979
type Oneshot = TokioOneshot;
80-
type Mutex<T: OptionalSend + OptionalSync + 'static> = TokioMutex<T>;
80+
type Mutex<T: OptionalSend + 'static> = TokioMutex<T>;
8181
}
8282

8383
pub struct TokioMpscUnbounded;
@@ -203,7 +203,7 @@ where T: OptionalSend
203203
type TokioMutex<T> = tokio::sync::Mutex<T>;
204204

205205
impl<T> mutex::Mutex<T> for TokioMutex<T>
206-
where T: OptionalSend + OptionalSync + 'static
206+
where T: OptionalSend + 'static
207207
{
208208
type Guard<'a> = tokio::sync::MutexGuard<'a, T>;
209209

openraft/src/type_config/async_runtime/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,5 +104,5 @@ pub trait AsyncRuntime: Debug + Default + PartialEq + Eq + OptionalSend + Option
104104

105105
type Oneshot: Oneshot;
106106

107-
type Mutex<T: OptionalSend + OptionalSync + 'static>: Mutex<T>;
107+
type Mutex<T: OptionalSend + 'static>: Mutex<T>;
108108
}

openraft/src/type_config/async_runtime/mutex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::OptionalSend;
55
use crate::OptionalSync;
66

77
/// Represents an implementation of an asynchronous Mutex.
8-
pub trait Mutex<T: OptionalSend + OptionalSync + 'static>: OptionalSend + OptionalSync {
8+
pub trait Mutex<T: OptionalSend + 'static>: OptionalSend + OptionalSync {
99
/// Handle to an acquired lock, should release it when dropped.
1010
type Guard<'a>: DerefMut<Target = T> + OptionalSend + OptionalSync
1111
where Self: 'a;

openraft/src/type_config/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ pub trait TypeConfigExt: RaftTypeConfig {
9797
/// This is just a wrapper of
9898
/// [`AsyncRuntime::Mutex::new()`](`crate::async_runtime::Mutex::new`).
9999
fn mutex<T>(value: T) -> MutexOf<Self, T>
100-
where T: OptionalSend + OptionalSync {
100+
where T: OptionalSend {
101101
MutexOf::<Self, T>::new(value)
102102
}
103103

0 commit comments

Comments
 (0)