/// Returns the direct sub-witness with the given label, if present.
///
/// This is the equivalent of looking up the label in the `LabeledTree::SubTree`
/// that this `Witness` was created from, pruned children excluded.
Returns the direct sub-witness with the given label, if present.
This is the equivalent of looking up the label in the `LabeledTree::SubTree`
that this `Witness` was created from, pruned children excluded.
Returns the direct sub - witness with the given label if present . This is the equivalent of looking up the label in the ` LabeledTree :: SubTree ` that this ` Witness ` was created from pruned children excluded .
pub fn sub_witness<'a>(witness: &'a Witness, lbl: &Label) -> Option<&'a Witness> {
    match witness {
        Witness::Fork {
            left_tree,
            right_tree,
        } => sub_witness(left_tree, lbl).or_else(|| sub_witness(right_tree, lbl)),
        Witness::Node { label, sub_witness } if label == lbl => Some(sub_witness),
        _ => None,
    }
}
pub fn sub_witness < ' a > ( witness : & ' a Witness , lbl : & Label ) -> Option < & ' a Witness > { match witness { Witness :: Fork { left_tree , right_tree , } => sub_witness ( left_tree , lbl ) . or_else ( | | sub_witness ( right_tree , lbl ) ) , Witness :: Node { label , sub_witness } if label == lbl => Some ( sub_witness ) , _ => None , } }
Returns the direct sub-witness with the given label, if present.
Returns the direct sub - witness with the given label if present .
witness
&'a Witness
lbl
&Label