keyfork-mnemonic-util: expose additional functions from wordlist

This commit is contained in:
Ryan Heywood 2023-12-22 14:35:53 -05:00
parent 920e04ba23
commit d452eba133
Signed by: ryan
GPG Key ID: 8E401478A3FBEF72
1 changed files with 6 additions and 1 deletions

View File

@ -64,8 +64,13 @@ impl Wordlist {
Arc::new(self)
}
/// Determine whether the Wordlist contains a given word.
pub fn contains(&self, word: &str) -> bool {
self.0.iter().any(|w| w.as_str() == word)
}
/// Given an index, get a word from the wordlist.
fn get_word(&self, word: usize) -> Option<&String> {
pub fn get_word(&self, word: usize) -> Option<&String> {
self.0.get(word)
}