From 37ab873d21ca1fcd43db8d6a26d5bac4f5285f71 Mon Sep 17 00:00:00 2001 From: Mica White Date: Wed, 25 Dec 2024 17:58:06 -0500 Subject: Move some logic into the Sharable trait --- src/collection/owned.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/collection/owned.rs') diff --git a/src/collection/owned.rs b/src/collection/owned.rs index 3ea08b5..714ff01 100644 --- a/src/collection/owned.rs +++ b/src/collection/owned.rs @@ -58,11 +58,6 @@ unsafe impl Lockable for OwnedLockCollection { where Self: 'g; - type ReadGuard<'g> - = L::ReadGuard<'g> - where - Self: 'g; - fn get_ptrs<'a>(&'a self, ptrs: &mut Vec<&'a dyn RawLock>) { self.data.get_ptrs(ptrs) } @@ -70,10 +65,6 @@ unsafe impl Lockable for OwnedLockCollection { unsafe fn guard(&self) -> Self::Guard<'_> { self.data.guard() } - - unsafe fn read_guard(&self) -> Self::ReadGuard<'_> { - self.data.read_guard() - } } impl LockableIntoInner for OwnedLockCollection { @@ -84,7 +75,16 @@ impl LockableIntoInner for OwnedLockCollection { } } -unsafe impl Sharable for OwnedLockCollection {} +unsafe impl Sharable for OwnedLockCollection { + type ReadGuard<'g> + = L::ReadGuard<'g> + where + Self: 'g; + + unsafe fn read_guard(&self) -> Self::ReadGuard<'_> { + self.data.read_guard() + } +} unsafe impl OwnedLockable for OwnedLockCollection {} -- cgit v1.2.3