From 4fd5136e0c0ec9cc92bb2b5735c0b3b68acdd755 Mon Sep 17 00:00:00 2001 From: Botahamec Date: Wed, 25 Sep 2024 21:36:13 -0400 Subject: Update docs for ref guards --- src/mutex.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/mutex.rs') diff --git a/src/mutex.rs b/src/mutex.rs index b30c2b1..433ab47 100644 --- a/src/mutex.rs +++ b/src/mutex.rs @@ -36,14 +36,18 @@ pub struct Mutex { data: UnsafeCell, } -/// A reference to a mutex that unlocks it when dropped +/// A reference to a mutex that unlocks it when dropped. +/// +/// This is similar to [`MutexGuard`], except it does not hold a [`Keyable`]. pub struct MutexRef<'a, T: ?Sized + 'a, R: RawMutex>( &'a Mutex, PhantomData<(&'a mut T, R::GuardMarker)>, ); -/// An RAII implementation of a “scoped lock” of a mutex. When this structure -/// is dropped (falls out of scope), the lock will be unlocked. +/// An RAII implementation of a “scoped lock” of a mutex. +/// +/// When this structure is dropped (falls out of scope), the lock will be +/// unlocked. /// /// This is created by calling the [`lock`] and [`try_lock`] methods on [`Mutex`] /// -- cgit v1.2.3