summaryrefslogtreecommitdiff
path: root/src/collection/boxed.rs
diff options
context:
space:
mode:
authorMica White <botahamec@gmail.com>2024-12-25 17:58:06 -0500
committerMica White <botahamec@gmail.com>2024-12-25 17:58:06 -0500
commit37ab873d21ca1fcd43db8d6a26d5bac4f5285f71 (patch)
tree987e0a0604c29ceea8d17e424df65993608c7ea5 /src/collection/boxed.rs
parentbfdbf20a813bb4b5527a3d6ff4a5c1bac134b466 (diff)
Move some logic into the Sharable trait
Diffstat (limited to 'src/collection/boxed.rs')
-rw-r--r--src/collection/boxed.rs14
1 files changed, 7 insertions, 7 deletions
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<L: Lockable> Lockable for BoxedLockCollection<L> {
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<L: Lockable> Lockable for BoxedLockCollection<L> {
unsafe fn guard(&self) -> Self::Guard<'_> {
self.data().guard()
}
+}
+
+unsafe impl<L: Sharable> Sharable for BoxedLockCollection<L> {
+ type ReadGuard<'g>
+ = L::ReadGuard<'g>
+ where
+ Self: 'g;
unsafe fn read_guard(&self) -> Self::ReadGuard<'_> {
self.data().read_guard()
}
}
-unsafe impl<L: Sharable> Sharable for BoxedLockCollection<L> {}
-
unsafe impl<L: OwnedLockable> OwnedLockable for BoxedLockCollection<L> {}
impl<L> IntoIterator for BoxedLockCollection<L>