Add Mnemonic::language getter

This commit is contained in:
Steven Roose 2021-04-01 14:56:25 +01:00
parent 63d3eab009
commit 3994ee95b0
No known key found for this signature in database
GPG Key ID: 2F2A88D7F8D68E87
1 changed files with 5 additions and 0 deletions

View File

@ -294,6 +294,11 @@ impl Mnemonic {
Mnemonic::generate_in(Language::English, word_count)
}
/// Get the language of the [Mnemonic].
pub fn language(&self) -> Language {
self.lang
}
/// Get an iterator over the words.
pub fn word_iter(&self) -> impl Iterator<Item = &'static str> + Clone + '_ {
let list = self.lang.word_list();