added as_leaf in AnyNode impl (#44)
Co-authored-by: Dafydd Durairaj <dafydd.durairaj@gmail.com>
This commit is contained in:
parent
cb43d3707f
commit
7d7ce24d56
|
@ -214,6 +214,14 @@ impl AnyNode {
|
|||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn as_leaf(&self) -> Option<&LeafNode> {
|
||||
match self.case() {
|
||||
Some(NodeRef::Leaf(leaf_ref)) => Some(leaf_ref),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn as_leaf_mut(&mut self) -> Option<&mut LeafNode> {
|
||||
match self.case_mut() {
|
||||
|
|
Loading…
Reference in New Issue