diff options
| author | Mica White <botahamec@gmail.com> | 2024-12-25 17:58:38 -0500 |
|---|---|---|
| committer | Mica White <botahamec@gmail.com> | 2024-12-25 22:44:03 -0500 |
| commit | 311842d28d1fbb6da945f0d98f1655f77a58abf9 (patch) | |
| tree | 4da3c8ab6fb3732c1ebb11306dab3799decd6b2c /src/mutex | |
| parent | 37ab873d21ca1fcd43db8d6a26d5bac4f5285f71 (diff) | |
as_mut re-organization
Diffstat (limited to 'src/mutex')
| -rw-r--r-- | src/mutex/mutex.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mutex/mutex.rs b/src/mutex/mutex.rs index 27a215f..4671b4f 100644 --- a/src/mutex/mutex.rs +++ b/src/mutex/mutex.rs @@ -7,7 +7,7 @@ use lock_api::RawMutex; use crate::handle_unwind::handle_unwind; use crate::key::Keyable; -use crate::lockable::{Lockable, LockableAsMut, LockableIntoInner, OwnedLockable, RawLock}; +use crate::lockable::{Lockable, LockableGetMut, LockableIntoInner, OwnedLockable, RawLock}; use crate::poisonable::PoisonFlag; use super::{Mutex, MutexGuard, MutexRef}; @@ -79,13 +79,13 @@ impl<T: Send, R: RawMutex + Send + Sync> LockableIntoInner for Mutex<T, R> { } } -impl<T: Send, R: RawMutex + Send + Sync> LockableAsMut for Mutex<T, R> { +impl<T: Send, R: RawMutex + Send + Sync> LockableGetMut for Mutex<T, R> { type Inner<'a> = &'a mut T where Self: 'a; - fn as_mut(&mut self) -> Self::Inner<'_> { + fn get_mut(&mut self) -> Self::Inner<'_> { self.get_mut() } } @@ -264,7 +264,7 @@ impl<T: ?Sized, R: RawMutex> Mutex<T, R> { /// thread::spawn(move || { /// let key = ThreadKey::get().unwrap(); /// let mut lock = c_mutex.try_lock(key); - /// if let Some(mut lock) = lock { + /// if let Ok(mut lock) = lock { /// *lock = 10; /// } else { /// println!("try_lock failed"); |
