summaryrefslogtreecommitdiff
path: root/src/collection/boxed.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/collection/boxed.rs')
-rwxr-xr-xsrc/collection/boxed.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/collection/boxed.rs b/src/collection/boxed.rs
index 3708c8b..3600d8e 100755
--- a/src/collection/boxed.rs
+++ b/src/collection/boxed.rs
@@ -153,7 +153,7 @@ impl<L> Drop for BoxedLockCollection<L> {
// safety: this collection will never be locked again
self.locks.clear();
// safety: this was allocated using a box, and is now unique
- let boxed: Box<UnsafeCell<L>> = Box::from_raw(self.data.cast_mut());
+ let boxed: Box<UnsafeCell<L>> = Box::from_raw(self.child.cast_mut());
drop(boxed)
}
@@ -171,7 +171,7 @@ impl<T: ?Sized, L: AsRef<T>> AsRef<T> for BoxedLockCollection<L> {
impl<L: Debug> Debug for BoxedLockCollection<L> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct(stringify!(BoxedLockCollection))
- .field("data", &self.data)
+ .field("data", &self.child)
// there's not much reason to show the sorted locks
.finish_non_exhaustive()
}
@@ -209,7 +209,7 @@ impl<L> BoxedLockCollection<L> {
// safety: this collection will never be used again
std::ptr::drop_in_place(&mut self.locks);
// safety: this was allocated using a box, and is now unique
- let boxed: Box<UnsafeCell<L>> = Box::from_raw(self.data.cast_mut());
+ let boxed: Box<UnsafeCell<L>> = Box::from_raw(self.child.cast_mut());
// to prevent a double free
std::mem::forget(self);
@@ -238,7 +238,7 @@ impl<L> BoxedLockCollection<L> {
#[must_use]
pub fn child(&self) -> &L {
unsafe {
- self.data
+ self.child
.as_ref()
.unwrap_unchecked()
.get()
@@ -329,7 +329,7 @@ impl<L: Lockable> BoxedLockCollection<L> {
// safety: we're just changing the lifetimes
let locks: Vec<&'static dyn RawLock> = std::mem::transmute(locks);
let data = &raw const *data;
- Self { data, locks }
+ Self { child: data, locks }
}
/// Creates a new collection of locks.