diff options
| author | Mica White <botahamec@outlook.com> | 2024-03-16 12:41:27 -0400 |
|---|---|---|
| committer | Mica White <botahamec@outlook.com> | 2024-03-16 12:41:27 -0400 |
| commit | 801a870467af4059d2abdc67f2899edebb1f6d6c (patch) | |
| tree | 4658040ec1ac93b5f8fd4d2796d8702a8ed2f3e0 /src/collection/boxed_collection.rs | |
| parent | ad76d43dc28b8802d64eb7ddcd9e02d3d12ac89a (diff) | |
retry lock collection
Diffstat (limited to 'src/collection/boxed_collection.rs')
| -rw-r--r-- | src/collection/boxed_collection.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/collection/boxed_collection.rs b/src/collection/boxed_collection.rs index bcb941b..1aae1e4 100644 --- a/src/collection/boxed_collection.rs +++ b/src/collection/boxed_collection.rs @@ -26,7 +26,7 @@ impl<'a, L> Drop for BoxedLockCollection<'a, L> { } } -impl<'a, L: OwnedLockable<'a> + 'a> BoxedLockCollection<'a, L> { +impl<'a, L: OwnedLockable> BoxedLockCollection<'a, L> { #[must_use] pub fn new(data: L) -> Self { let boxed = Box::leak(Box::new(data)); @@ -34,18 +34,18 @@ impl<'a, L: OwnedLockable<'a> + 'a> BoxedLockCollection<'a, L> { } } -impl<'a, L: OwnedLockable<'a> + 'a> BoxedLockCollection<'a, &'a L> { +impl<'a, L: OwnedLockable> BoxedLockCollection<'a, &'a L> { #[must_use] pub fn new_ref(data: &'a L) -> Self { let boxed = Box::leak(Box::new(data)); - // this is a reference to an OwnedLockable, which can't possibly - // contain inner duplicates + // safety: this is a reference to an OwnedLockable, which can't + // possibly contain inner duplicates Self(unsafe { RefLockCollection::new_unchecked(boxed) }) } } -impl<'a, L: Lockable<'a> + 'a> BoxedLockCollection<'a, L> { +impl<'a, L: Lockable> BoxedLockCollection<'a, L> { #[must_use] pub unsafe fn new_unchecked(data: L) -> Self { let boxed = Box::leak(Box::new(data)); |
