From 311842d28d1fbb6da945f0d98f1655f77a58abf9 Mon Sep 17 00:00:00 2001 From: Mica White Date: Wed, 25 Dec 2024 17:58:38 -0500 Subject: as_mut re-organization --- src/rwlock/rwlock.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/rwlock/rwlock.rs') 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 LockableIntoInner for RwLock { } } -impl LockableAsMut for RwLock { +impl LockableGetMut for RwLock { 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 RwLock { /// 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>( -- cgit v1.2.3