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/rwlock/rwlock.rs | |
| parent | f5cb25b01f265c9247bd0cb8955addcbaa94fea2 (diff) | |
Implemented necessary traits
Diffstat (limited to 'src/rwlock/rwlock.rs')
| -rw-r--r-- | src/rwlock/rwlock.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/rwlock/rwlock.rs b/src/rwlock/rwlock.rs index 7070b0e..9a7590a 100644 --- a/src/rwlock/rwlock.rs +++ b/src/rwlock/rwlock.rs @@ -40,12 +40,6 @@ impl<T, R: RawRwLock> RwLock<T, R> { } } -impl<T: ?Sized + Default, R: RawRwLock> Default for RwLock<T, R> { - fn default() -> Self { - Self::new(T::default()) - } -} - impl<T: ?Sized + Debug, R: RawRwLock> Debug for RwLock<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 @@ -68,6 +62,12 @@ impl<T: ?Sized + Debug, R: RawRwLock> Debug for RwLock<T, R> { } } +impl<T: ?Sized + Default, R: RawRwLock> Default for RwLock<T, R> { + fn default() -> Self { + Self::new(T::default()) + } +} + impl<T, R: RawRwLock> From<T> for RwLock<T, R> { fn from(value: T) -> Self { Self::new(value) |
