diff options
| author | Mica White <botahamec@gmail.com> | 2024-12-26 11:26:39 -0500 |
|---|---|---|
| committer | Mica White <botahamec@gmail.com> | 2024-12-26 12:06:47 -0500 |
| commit | dc16634f4abdb1e830d2749e64b419740702b302 (patch) | |
| tree | eb51ba8293a1c719c7221d546185cfa7062c108c /src/mutex/guard.rs | |
| parent | 096afea6f13692fddbfad0b07e5377cb2e81dd58 (diff) | |
Commenting
Diffstat (limited to 'src/mutex/guard.rs')
| -rw-r--r-- | src/mutex/guard.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mutex/guard.rs b/src/mutex/guard.rs index e661230..0d35cf4 100644 --- a/src/mutex/guard.rs +++ b/src/mutex/guard.rs @@ -10,6 +10,9 @@ use crate::lockable::RawLock; use super::{Mutex, MutexGuard, MutexRef}; +// These impls make things slightly easier because now you can use +// `println!("{guard}")` instead of `println!("{}", *guard)` + impl<T: PartialEq + ?Sized, R: RawMutex> PartialEq for MutexRef<'_, T, R> { fn eq(&self, other: &Self) -> bool { self.deref().eq(&**other) @@ -36,8 +39,6 @@ impl<T: Hash + ?Sized, R: RawMutex> Hash for MutexRef<'_, T, R> { } } -// This makes things slightly easier because now you can use -// `println!("{guard}")` instead of `println!("{}", *guard)` impl<T: Debug + ?Sized, R: RawMutex> Debug for MutexRef<'_, T, R> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { Debug::fmt(&**self, f) |
