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/rwlock | |
| parent | 37ab873d21ca1fcd43db8d6a26d5bac4f5285f71 (diff) | |
as_mut re-organization
Diffstat (limited to 'src/rwlock')
| -rw-r--r-- | src/rwlock/rwlock.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/rwlock/rwlock.rs b/src/rwlock/rwlock.rs index 2c9ba22..66c7362 100644 --- a/src/rwlock/rwlock.rs +++ b/src/rwlock/rwlock.rs @@ -8,7 +8,7 @@ use lock_api::RawRwLock; use crate::handle_unwind::handle_unwind; use crate::key::Keyable; use crate::lockable::{ - Lockable, LockableAsMut, LockableIntoInner, OwnedLockable, RawLock, Sharable, + Lockable, LockableGetMut, LockableIntoInner, OwnedLockable, RawLock, Sharable, }; use super::{PoisonFlag, RwLock, RwLockReadGuard, RwLockReadRef, RwLockWriteGuard, RwLockWriteRef}; @@ -96,13 +96,13 @@ impl<T: Send, R: RawRwLock + Send + Sync> LockableIntoInner for RwLock<T, R> { } } -impl<T: Send, R: RawRwLock + Send + Sync> LockableAsMut for RwLock<T, R> { +impl<T: Send, R: RawRwLock + Send + Sync> LockableGetMut for RwLock<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<'_> { AsMut::as_mut(self) } } @@ -279,8 +279,8 @@ impl<T: ?Sized, R: RawRwLock> RwLock<T, R> { /// let lock = RwLock::new(1); /// /// match lock.try_read(key) { - /// Some(n) => assert_eq!(*n, 1), - /// None => unreachable!(), + /// Ok(n) => assert_eq!(*n, 1), + /// Err(_) => unreachable!(), /// }; /// ``` pub fn try_read<'s, 'key: 's, Key: Keyable>( |
