/** Adds a word into the data structure. */
Adds a word into the data structure.
Adds a word into the data structure .
pub fn add_word(&mut self, word: String) {
        let mut node = &mut self.trie.next;
        for idx in word.bytes().map(|b| (b - b'a') as usize) {
            let nodes = &mut node.0;
            let next = unsafe { nodes.get_unchecked_mut(idx) };
            if next.is_none() {
                *next = Some(Box::new(Default::default()));
            }
            node = &mut next.as_mut().unwrap().next;
        }
        node.1 = true;
    }
pub fn add_word ( & mut self , word : String ) { let mut node = & mut self . trie . next ; for idx in word . bytes ( ) . map ( | b | ( b - b'a' ) as usize ) { let nodes = & mut node . 0 ; let next = unsafe { nodes . get_unchecked_mut ( idx ) } ; if next . is_none ( ) { * next = Some ( Box :: new ( Default :: default ( ) ) ) ; } node = & mut next . as_mut ( ) . unwrap ( ) . next ; } node . 1 = true ; }
Adds a word into the data structure.
Adds a word into the data structure .
&mut self
word
String