pub(crate) const fn is_unique_set(nodes: &'static [Self]) -> bool {
        let mut index = 0;

        while index < nodes.len() {
            match &nodes[index] {
                TagTree::Choice(inner_tags) => {
                    if !Self::is_unique_set(inner_tags) {
                        return false;
                    }

                    let mut inner_index = 0;
                    while inner_index < inner_tags.len() {
                        if Self::tree_contains(
                            &inner_tags[inner_index],
                            konst::slice::slice_from(nodes, index + 1),
                        ) {
                            return false;
                        }

                        inner_index += 1;
                    }
                }

                TagTree::Leaf(tag) => {
                    // We're at the last element so there's nothing more to
                    // compare to.
                    if index + 1 == nodes.len() {
                        return true;
                    }

                    if Self::tag_contains(tag, konst::slice::slice_from(nodes, index + 1)) {
                        return false;
                    }
                }
            }

            index += 1;
        }

        true
    }
/// Checks whether a given set of nodes only contains unique entries.
Checks whether a given set of nodes only contains unique entries.
Checks whether a given set of nodes only contains unique entries .
pub(crate) const fn is_unique_set(nodes: &'static [Self]) -> bool {
        let mut index = 0;
        while index < nodes.len() {
            match &nodes[index] {
                TagTree::Choice(inner_tags) => {
                    if !Self::is_unique_set(inner_tags) {
                        return false;
                    }
                    let mut inner_index = 0;
                    while inner_index < inner_tags.len() {
                        if Self::tree_contains(
                            &inner_tags[inner_index],
                            konst::slice::slice_from(nodes, index + 1),
                        ) {
                            return false;
                        }
                        inner_index += 1;
                    }
                }
                TagTree::Leaf(tag) => {
                    // We're at the last element so there's nothing more to
                    // compare to.
                    if index + 1 == nodes.len() {
                        return true;
                    }
                    if Self::tag_contains(tag, konst::slice::slice_from(nodes, index + 1)) {
                        return false;
                    }
                }
            }
            index += 1;
        }
        true
    }
pub ( crate ) const fn is_unique_set ( nodes : & ' static [ Self ] ) -> bool { let mut index = 0 ; while index < nodes . len ( ) { match & nodes [ index ] { TagTree :: Choice ( inner_tags ) => { if ! Self :: is_unique_set ( inner_tags ) { return false ; } let mut inner_index = 0 ; while inner_index < inner_tags . len ( ) { if Self :: tree_contains ( & inner_tags [ inner_index ] , konst :: slice :: slice_from ( nodes , index + 1 ) , ) { return false ; } inner_index += 1 ; } } TagTree :: Leaf ( tag ) => { // We're at the last element so there's nothing more to // compare to. if index + 1 == nodes . len ( ) { return true ; } if Self :: tag_contains ( tag , konst :: slice :: slice_from ( nodes , index + 1 ) ) { return false ; } } } index += 1 ; } true }
Checks whether a given set of nodes only contains unique entries.
Checks whether a given set of nodes only contains unique entries .
nodes
&'static [Self]
nodes
&'static [Self]