Use matches.value_of_t

This commit is contained in:
Richard Feldman 2022-05-05 18:00:47 -04:00
parent da3490be8b
commit d337a80ff5
No known key found for this signature in database
GPG key ID: 7E4127D1E4241798
2 changed files with 11 additions and 13 deletions

View file

@ -669,15 +669,15 @@ impl std::fmt::Display for Target {
}
impl std::str::FromStr for Target {
type Err = ();
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
fn from_str(string: &str) -> Result<Self, Self::Err> {
match string {
"system" => Ok(Target::System),
"linux32" => Ok(Target::Linux32),
"linux64" => Ok(Target::Linux64),
"wasm32" => Ok(Target::Wasm32),
_ => Err(()),
_ => Err(format!("Roc does not know how to compile to {}", string)),
}
}
}