diff --git a/src/lib.rs b/src/lib.rs index 3b57cd7..0fbe66f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -260,6 +260,14 @@ impl Mnemonic { Err(Error::AmbiguousWordList(langs)) } + /// Parse a mnemonic in the given language. + pub fn parse_in<'a, S: Into>>(language: Language, s: S) -> Result { + let mut cow = s.into(); + Mnemonic::normalize_utf8_cow(&mut cow); + Mnemonic::validate_in(language, cow.as_ref())?; + Ok(Mnemonic(cow.into_owned())) + } + /// Parse a mnemonic and detect the language from the enabled languages. pub fn parse<'a, S: Into>>(s: S) -> Result { let mut cow = s.into(); @@ -269,14 +277,6 @@ impl Mnemonic { Ok(Mnemonic(cow.into_owned())) } - /// Parse a mnemonic in the given language. - pub fn parse_in<'a, S: Into>>(language: Language, s: S) -> Result { - let mut cow = s.into(); - Mnemonic::normalize_utf8_cow(&mut cow); - Mnemonic::validate_in(language, cow.as_ref())?; - Ok(Mnemonic(cow.into_owned())) - } - /// Get the mnemonic as a [&str]. pub fn as_str(&self) -> &str { &self.0