From 2096d0c6819ce0e8f6c6e77e36ebc495924dad63 Mon Sep 17 00:00:00 2001 From: Mica White Date: Sat, 7 Feb 2026 10:45:11 -0500 Subject: Rename data to child --- src/collection/boxed.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/collection/boxed.rs') 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 Drop for BoxedLockCollection { // 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> = Box::from_raw(self.data.cast_mut()); + let boxed: Box> = Box::from_raw(self.child.cast_mut()); drop(boxed) } @@ -171,7 +171,7 @@ impl> AsRef for BoxedLockCollection { impl Debug for BoxedLockCollection { 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 BoxedLockCollection { // 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> = Box::from_raw(self.data.cast_mut()); + let boxed: Box> = Box::from_raw(self.child.cast_mut()); // to prevent a double free std::mem::forget(self); @@ -238,7 +238,7 @@ impl BoxedLockCollection { #[must_use] pub fn child(&self) -> &L { unsafe { - self.data + self.child .as_ref() .unwrap_unchecked() .get() @@ -329,7 +329,7 @@ impl BoxedLockCollection { // 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. -- cgit v1.2.3