fn random<R: Rng>(&self, rng: &mut R) -> Word {
        let idx = rng.gen_range(0, self.total_words);
        let mut words_so_far = 0;
        for (i, data_vec) in self.word_data.iter().enumerate() {
            let len = (i + 1) as u8;
            let words = data_vec.len() / (len as usize);
            words_so_far += words;
            if words_so_far > idx {
                return Word { len, idx: idx - (words_so_far - words) }
            }
        }
        unreachable!()
    }
/// Return the index of a random word.
Return the index of a random word.
Return the index of a random word .
fn random<R: Rng>(&self, rng: &mut R) -> Word {
        let idx = rng.gen_range(0, self.total_words);
        let mut words_so_far = 0;
        for (i, data_vec) in self.word_data.iter().enumerate() {
            let len = (i + 1) as u8;
            let words = data_vec.len() / (len as usize);
            words_so_far += words;
            if words_so_far > idx {
                return Word { len, idx: idx - (words_so_far - words) }
            }
        }
        unreachable!()
    }
fn random < R : Rng > ( & self , rng : & mut R ) -> Word { let idx = rng . gen_range ( 0 , self . total_words ) ; let mut words_so_far = 0 ; for ( i , data_vec ) in self . word_data . iter ( ) . enumerate ( ) { let len = ( i + 1 ) as u8 ; let words = data_vec . len ( ) / ( len as usize ) ; words_so_far += words ; if words_so_far > idx { return Word { len , idx : idx - ( words_so_far - words ) } } } unreachable ! ( ) }
Return the index of a random word.
Return the index of a random word .
&self
rng
&mut R