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/ref.rs | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/collection/ref.rs') diff --git a/src/collection/ref.rs b/src/collection/ref.rs index d180ab0..4ba06bd 100755 --- a/src/collection/ref.rs +++ b/src/collection/ref.rs @@ -17,7 +17,7 @@ where type IntoIter = <&'a L as IntoIterator>::IntoIter; fn into_iter(self) -> Self::IntoIter { - self.data.into_iter() + self.child.into_iter() } } @@ -77,11 +77,11 @@ unsafe impl Lockable for RefLockCollection<'_, L> { } unsafe fn guard(&self) -> Self::Guard<'_> { - self.data.guard() + self.child.guard() } unsafe fn data_mut(&self) -> Self::DataMut<'_> { - self.data.data_mut() + self.child.data_mut() } } @@ -97,17 +97,17 @@ unsafe impl Sharable for RefLockCollection<'_, L> { Self: 'a; unsafe fn read_guard(&self) -> Self::ReadGuard<'_> { - self.data.read_guard() + self.child.read_guard() } unsafe fn data_ref(&self) -> Self::DataRef<'_> { - self.data.data_ref() + self.child.data_ref() } } impl> AsRef for RefLockCollection<'_, L> { fn as_ref(&self) -> &T { - self.data.as_ref() + self.child.as_ref() } } @@ -116,7 +116,7 @@ impl> AsRef for RefLockCollection<'_, L> { impl Debug for RefLockCollection<'_, L> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.debug_struct(stringify!(RefLockCollection)) - .field("data", self.data) + .field("data", self.child) // there's not much reason to show the sorting order .finish_non_exhaustive() } @@ -152,7 +152,7 @@ impl<'a, L: OwnedLockable> RefLockCollection<'a, L> { pub fn new(data: &'a L) -> Self { RefLockCollection { locks: get_locks(data), - data, + child: data, } } } @@ -179,7 +179,7 @@ impl RefLockCollection<'_, L> { /// ``` #[must_use] pub const fn child(&self) -> &L { - self.data + self.child } } @@ -207,7 +207,7 @@ impl<'a, L: Lockable> RefLockCollection<'a, L> { #[must_use] pub unsafe fn new_unchecked(data: &'a L) -> Self { Self { - data, + child: data, locks: get_locks(data), } } @@ -237,7 +237,7 @@ impl<'a, L: Lockable> RefLockCollection<'a, L> { return None; } - Some(Self { data, locks }) + Some(Self { child: data, locks }) } pub fn scoped_lock<'s, R>( @@ -283,7 +283,7 @@ impl<'a, L: Lockable> RefLockCollection<'a, L> { self.raw_write(); // safety: we've locked all of this already - self.data.guard() + self.child.guard() }; LockGuard { guard, key } @@ -327,7 +327,7 @@ impl<'a, L: Lockable> RefLockCollection<'a, L> { } // safety: we've acquired the locks - self.data.guard() + self.child.guard() }; Ok(LockGuard { guard, key }) @@ -403,7 +403,7 @@ impl RefLockCollection<'_, L> { LockGuard { // safety: we've already acquired the lock - guard: self.data.read_guard(), + guard: self.child.read_guard(), key, } } @@ -448,7 +448,7 @@ impl RefLockCollection<'_, L> { } // safety: we've acquired the locks - self.data.read_guard() + self.child.read_guard() }; Ok(LockGuard { guard, key }) -- cgit v1.2.3