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/retry.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/collection/retry.rs') diff --git a/src/collection/retry.rs b/src/collection/retry.rs index 42d86e5..0c44dea 100644 --- a/src/collection/retry.rs +++ b/src/collection/retry.rs @@ -219,11 +219,6 @@ unsafe impl Lockable for RetryingLockCollection { 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) } @@ -231,10 +226,6 @@ unsafe impl Lockable for RetryingLockCollection { unsafe fn guard(&self) -> Self::Guard<'_> { self.data.guard() } - - unsafe fn read_guard(&self) -> Self::ReadGuard<'_> { - self.data.read_guard() - } } impl LockableAsMut for RetryingLockCollection { @@ -256,7 +247,16 @@ impl LockableIntoInner for RetryingLockCollection { } } -unsafe impl Sharable for RetryingLockCollection {} +unsafe impl Sharable for RetryingLockCollection { + type ReadGuard<'g> + = L::ReadGuard<'g> + where + Self: 'g; + + unsafe fn read_guard(&self) -> Self::ReadGuard<'_> { + self.data.read_guard() + } +} unsafe impl OwnedLockable for RetryingLockCollection {} -- cgit v1.2.3