summaryrefslogtreecommitdiff
path: root/src/collection/boxed_collection.rs
diff options
context:
space:
mode:
authorBotahamec <botahamec@outlook.com>2024-05-21 13:18:10 -0400
committerBotahamec <botahamec@outlook.com>2024-05-21 13:18:10 -0400
commit6e3aa5182604b30ef75ba5676e9f677cc1d18fe3 (patch)
treed8e23a82c8151c4b49c15f49707d96651764db39 /src/collection/boxed_collection.rs
parent875d5c4ad6e0c2a78c15476584fc686121b340d3 (diff)
parentc344021797b7e1f8027bd9d1302908f0767e362b (diff)
Merge remote-tracking branch 'origin/0.2' into 0.2
Diffstat (limited to 'src/collection/boxed_collection.rs')
-rw-r--r--src/collection/boxed_collection.rs10
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));