/// Descends into the subtree of `t` following the given `path`.
/// Returns the reference to the corresponding subtree.
Descends into the subtree of `t` following the given `path`.
Returns the reference to the corresponding subtree.
Descends into the subtree of ` t ` following the given ` path ` . Returns the reference to the corresponding subtree .
pub fn lookup_path<'a>(
    t: &'a LabeledTree<Vec<u8>>,
    path: &[&[u8]],
) -> Option<&'a LabeledTree<Vec<u8>>> {
    let mut tref = t;
    for l in path.iter() {
        match tref {
            LabeledTree::Leaf(_) => return None,
            LabeledTree::SubTree(children) => {
                tref = children.get(&Label::from(l))?;
            }
        }
    }
    Some(tref)
}
pub fn lookup_path < ' a > ( t : & ' a LabeledTree < Vec < u8 > > , path : & [ & [ u8 ] ] , ) -> Option < & ' a LabeledTree < Vec < u8 > > > { let mut tref = t ; for l in path . iter ( ) { match tref { LabeledTree :: Leaf ( _ ) => return None , LabeledTree :: SubTree ( children ) => { tref = children . get ( & Label :: from ( l ) ) ? ; } } } Some ( tref ) }
Descends into the subtree of `t` following the given `path`.
Descends into the subtree of ` t ` following the given ` path ` .
t
&'a LabeledTree<Vec<u8>>
path
&[&[u8]]