diff options
| author | Botahamec <botahamec@outlook.com> | 2024-05-22 15:53:49 -0400 |
|---|---|---|
| committer | Botahamec <botahamec@outlook.com> | 2024-05-22 15:53:49 -0400 |
| commit | ebbe3cfce28914d776f3e5f89894fab50911c57e (patch) | |
| tree | 7ecb7357b9decbe37817eea57e51346aaf055438 /src/mutex/mutex.rs | |
| parent | f5cb25b01f265c9247bd0cb8955addcbaa94fea2 (diff) | |
Implemented necessary traits
Diffstat (limited to 'src/mutex/mutex.rs')
| -rw-r--r-- | src/mutex/mutex.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mutex/mutex.rs b/src/mutex/mutex.rs index 3b8c221..52b6081 100644 --- a/src/mutex/mutex.rs +++ b/src/mutex/mutex.rs @@ -43,12 +43,6 @@ impl<T, R: RawMutex> Mutex<T, R> { } } -impl<T: ?Sized + Default, R: RawMutex> Default for Mutex<T, R> { - fn default() -> Self { - Self::new(T::default()) - } -} - impl<T: ?Sized + Debug, R: RawMutex> Debug for Mutex<T, R> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { // safety: this is just a try lock, and the value is dropped @@ -71,6 +65,12 @@ impl<T: ?Sized + Debug, R: RawMutex> Debug for Mutex<T, R> { } } +impl<T: ?Sized + Default, R: RawMutex> Default for Mutex<T, R> { + fn default() -> Self { + Self::new(T::default()) + } +} + impl<T, R: RawMutex> From<T> for Mutex<T, R> { fn from(value: T) -> Self { Self::new(value) |
