_ 2024-10-01 23:25:29 +00:00
parent 27a6c614d5
commit cdf233619f
1 changed files with 6 additions and 6 deletions

View File

@ -28,14 +28,14 @@ impl Default for Dice {
assert_eq!(words[600], "large");
assert_eq!(words[1252], "zoom");
Self {
words,
}
Self { words }
}
}
impl Dice {
pub fn pick_word(&self) -> &str {
self.words.choose(&mut rand::thread_rng ()).expect("`choose` should always return `Some`")
self.words
.choose(&mut rand::thread_rng())
.expect("`choose` should always return `Some`")
}
}