Skip to content

Commit

Permalink
Replace try! macro with '?' operator.
Browse files Browse the repository at this point in the history
Building with 'cargo build -vv' complains about `try!` being deprecated.
Replace with functionally-identical '?' operator.
  • Loading branch information
sielicki committed Apr 28, 2021
1 parent 5c385a9 commit c557903
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ impl Version {
}
num.push(c);
}
let major = try!(num.parse::<u32>().map_err(|e| e.to_string()));
let major = num.parse::<u32>().map_err(|e| e.to_string())?;

num.clear();
for c in parts[1].chars() {
Expand All @@ -144,7 +144,7 @@ impl Version {
}
num.push(c);
}
let minor = try!(num.parse::<u32>().map_err(|e| e.to_string()));
let minor = num.parse::<u32>().map_err(|e| e.to_string())?;

num.clear();
for c in parts[2].chars() {
Expand All @@ -153,7 +153,7 @@ impl Version {
}
num.push(c);
}
let patch = try!(num.parse::<u32>().map_err(|e| e.to_string()));
let patch = num.parse::<u32>().map_err(|e| e.to_string())?;

Ok(Version {
major: major,
Expand Down

0 comments on commit c557903

Please sign in to comment.