api: lowercase lang

This commit is contained in:
Dmitriy Pleshevskiy 2022-05-15 23:27:03 +03:00
parent d15faa1f65
commit 57b3816a44
1 changed files with 3 additions and 3 deletions

View File

@ -29,9 +29,9 @@ impl FromStr for Lang {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"Rus" | "rus" => Ok(Lang::Rus),
"Eng" | "eng" => Ok(Lang::Eng),
match &s.to_lowercase()[..] {
"rus" => Ok(Lang::Rus),
"eng" => Ok(Lang::Eng),
_ => Err(()),
}
}