diff --git a/cl-structures/src/tree.rs b/cl-structures/src/tree.rs index d6f1c18..d099596 100644 --- a/cl-structures/src/tree.rs +++ b/cl-structures/src/tree.rs @@ -158,6 +158,9 @@ impl Node { std::mem::replace(&mut self.value, value) } + pub fn parent(&self) -> Option> { + self.parent + } pub fn children(&self) -> &[Ref] { &self.children } diff --git a/cl-structures/src/tree/tree_ref.rs b/cl-structures/src/tree/tree_ref.rs index 5cf0997..5ea27af 100644 --- a/cl-structures/src/tree/tree_ref.rs +++ b/cl-structures/src/tree/tree_ref.rs @@ -10,7 +10,7 @@ use std::{marker::PhantomData, num::NonZeroUsize}; pub struct Ref(NonZeroUsize, PhantomData); impl Ref { - /// Constructs a new [TreeRef] with the given index + /// Constructs a new [Ref] with the given index pub fn new_unchecked(index: usize) -> Self { // Safety: index cannot be zero because we use saturating addition on unsigned type. Self(