Match more osu! play mode strings

This commit is contained in:
Natsu Kagami 2020-06-14 21:45:16 -04:00
parent cafa65581c
commit cfd848767d
Signed by: nki
GPG key ID: 73376E117CD20735

View file

@ -180,11 +180,11 @@ struct ModeArg(Mode);
impl FromStr for ModeArg {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
Ok(ModeArg(match s {
"std" => Mode::Std,
"taiko" => Mode::Taiko,
"catch" => Mode::Catch,
"mania" => Mode::Mania,
Ok(ModeArg(match &s.to_lowercase()[..] {
"osu" | "std" => Mode::Std,
"taiko" | "osu!taiko" => Mode::Taiko,
"ctb" | "fruits" | "catch" | "osu!ctb" | "osu!catch" => Mode::Catch,
"osu!mania" | "mania" => Mode::Mania,
_ => return Err(format!("Unknown mode {}", s)),
}))
}