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/boxed.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/collection/boxed.rs') diff --git a/src/collection/boxed.rs b/src/collection/boxed.rs index 6db0683..3766bed 100644 --- a/src/collection/boxed.rs +++ b/src/collection/boxed.rs @@ -62,11 +62,6 @@ unsafe impl Lockable for BoxedLockCollection { where Self: 'g; - type ReadGuard<'g> - = L::ReadGuard<'g> - where - Self: 'g; - fn get_ptrs<'a>(&'a self, ptrs: &mut Vec<&'a dyn RawLock>) { ptrs.extend(self.locks()) } @@ -74,14 +69,19 @@ unsafe impl Lockable for BoxedLockCollection { unsafe fn guard(&self) -> Self::Guard<'_> { self.data().guard() } +} + +unsafe impl Sharable for BoxedLockCollection { + type ReadGuard<'g> + = L::ReadGuard<'g> + where + Self: 'g; unsafe fn read_guard(&self) -> Self::ReadGuard<'_> { self.data().read_guard() } } -unsafe impl Sharable for BoxedLockCollection {} - unsafe impl OwnedLockable for BoxedLockCollection {} impl IntoIterator for BoxedLockCollection -- cgit v1.2.3