summaryrefslogtreecommitdiff
path: root/src/collection/owned.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/owned.rs
parentbfdbf20a813bb4b5527a3d6ff4a5c1bac134b466 (diff)
Move some logic into the Sharable trait
Diffstat (limited to 'src/collection/owned.rs')
-rw-r--r--src/collection/owned.rs20
1 files changed, 10 insertions, 10 deletions
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<L: Lockable> Lockable for OwnedLockCollection<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>) {
self.data.get_ptrs(ptrs)
}
@@ -70,10 +65,6 @@ unsafe impl<L: Lockable> Lockable for OwnedLockCollection<L> {
unsafe fn guard(&self) -> Self::Guard<'_> {
self.data.guard()
}
-
- unsafe fn read_guard(&self) -> Self::ReadGuard<'_> {
- self.data.read_guard()
- }
}
impl<L: LockableIntoInner> LockableIntoInner for OwnedLockCollection<L> {
@@ -84,7 +75,16 @@ impl<L: LockableIntoInner> LockableIntoInner for OwnedLockCollection<L> {
}
}
-unsafe impl<L: Sharable> Sharable for OwnedLockCollection<L> {}
+unsafe impl<L: Sharable> Sharable for OwnedLockCollection<L> {
+ type ReadGuard<'g>
+ = L::ReadGuard<'g>
+ where
+ Self: 'g;
+
+ unsafe fn read_guard(&self) -> Self::ReadGuard<'_> {
+ self.data.read_guard()
+ }
+}
unsafe impl<L: OwnedLockable> OwnedLockable for OwnedLockCollection<L> {}