summaryrefslogtreecommitdiff
path: root/src/collection/ref.rs
diff options
context:
space:
mode:
authorMica White <botahamec@outlook.com>2026-02-07 10:45:11 -0500
committerMica White <botahamec@outlook.com>2026-02-07 10:45:11 -0500
commit2096d0c6819ce0e8f6c6e77e36ebc495924dad63 (patch)
treefcee36a7aa3e3d77a8d57d1585d6ee095b4ff676 /src/collection/ref.rs
parent9d928375ffc365d9ae4f4bc9be4a3c08fae47387 (diff)
Rename data to child
Diffstat (limited to 'src/collection/ref.rs')
-rwxr-xr-xsrc/collection/ref.rs30
1 files changed, 15 insertions, 15 deletions
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<L: Lockable> 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<L: Sharable> 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<T: ?Sized, L: AsRef<T>> AsRef<T> for RefLockCollection<'_, L> {
fn as_ref(&self) -> &T {
- self.data.as_ref()
+ self.child.as_ref()
}
}
@@ -116,7 +116,7 @@ impl<T: ?Sized, L: AsRef<T>> AsRef<T> for RefLockCollection<'_, L> {
impl<L: Debug> 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<L> 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<L: Sharable> 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<L: Sharable> RefLockCollection<'_, L> {
}
// safety: we've acquired the locks
- self.data.read_guard()
+ self.child.read_guard()
};
Ok(LockGuard { guard, key })