Skip to content

Commit

Permalink
fix CI for clippy 0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
SenseTime-Cloud committed Jun 1, 2020
1 parent 7653ec3 commit 7d057ad
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ matrix:
- rust: stable
- rust: beta
- rust: nightly
- rust: 1.31.0
- rust: 1.33.0
- rust: nightly
env: CLIPPY
script: |
Expand Down
16 changes: 8 additions & 8 deletions src/yaml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,19 +288,19 @@ impl Yaml {
// This function falls back to Yaml::String if nothing else matches.
pub fn from_str(v: &str) -> Yaml {
if v.starts_with("0x") {
let n = i64::from_str_radix(&v[2..], 16);
if n.is_ok() {
return Yaml::Integer(n.unwrap());
if let Ok(i) = i64::from_str_radix(&v[2..], 16) {
return Yaml::Integer(i);
}
}
if v.starts_with("0o") {
let n = i64::from_str_radix(&v[2..], 8);
if n.is_ok() {
return Yaml::Integer(n.unwrap());
if let Ok(i) = i64::from_str_radix(&v[2..], 8) {
return Yaml::Integer(i);
}
}
if v.starts_with('+') && v[1..].parse::<i64>().is_ok() {
return Yaml::Integer(v[1..].parse::<i64>().unwrap());
if v.starts_with('+') {
if let Ok(i) = v[1..].parse::<i64>() {
return Yaml::Integer(i);
}
}
match v {
"~" | "null" => Yaml::Null,
Expand Down

0 comments on commit 7d057ad

Please sign in to comment.