fn insert(&mut self, word: &str) -> Word {
        let len = word.len();
        assert!(0 < len && len < (MAX_WORD_LEN as usize));
        while self.word_data.len() < len {
            self.word_data.push(Vec::new());
        }
        let data_vec = &mut self.word_data[len - 1];
        let idx = data_vec.len() / len;
        for b in word.bytes() {
            assert!(b.is_ascii_lowercase());
            data_vec.push(b);
        }
        self.total_words += 1;
        Word {
            len: len as u8,
            idx,
        }
    }
/// Add a word to the list and return its index.
Add a word to the list and return its index.
Add a word to the list and return its index .
fn insert(&mut self, word: &str) -> Word {
        let len = word.len();
        assert!(0 < len && len < (MAX_WORD_LEN as usize));
        while self.word_data.len() < len {
            self.word_data.push(Vec::new());
        }
        let data_vec = &mut self.word_data[len - 1];
        let idx = data_vec.len() / len;
        for b in word.bytes() {
            assert!(b.is_ascii_lowercase());
            data_vec.push(b);
        }
        self.total_words += 1;
        Word {
            len: len as u8,
            idx,
        }
    }
fn insert ( & mut self , word : & str ) -> Word { let len = word . len ( ) ; assert ! ( 0 len len ( MAX_WORD_LEN as usize ) ) ; while self . word_data . len ( ) < len { self . word_data . push ( Vec :: new ( ) ) ; } let data_vec = & mut self . word_data [ len - 1 ] ; let idx = data_vec . len ( ) / len ; for b in word . bytes ( ) { assert ! ( b is_ascii_lowercase ( ) ) ; data_vec . push ( b ) ; } self . total_words += 1 ; Word { len : len as u8 , idx , } }
Add a word to the list and return its index.
Add a word to the list and return its index .
&mut self
word
&str