fix CI for clippy 0.9
This commit is contained in:
parent
b28f7deeb7
commit
e35bbd7c5a
2 changed files with 9 additions and 9 deletions
|
@ -5,7 +5,7 @@ matrix:
|
||||||
- rust: stable
|
- rust: stable
|
||||||
- rust: beta
|
- rust: beta
|
||||||
- rust: nightly
|
- rust: nightly
|
||||||
- rust: 1.31.0
|
- rust: 1.33.0
|
||||||
- rust: nightly
|
- rust: nightly
|
||||||
env: CLIPPY
|
env: CLIPPY
|
||||||
script: |
|
script: |
|
||||||
|
|
|
@ -288,19 +288,19 @@ impl Yaml {
|
||||||
// This function falls back to Yaml::String if nothing else matches.
|
// This function falls back to Yaml::String if nothing else matches.
|
||||||
pub fn from_str(v: &str) -> Yaml {
|
pub fn from_str(v: &str) -> Yaml {
|
||||||
if v.starts_with("0x") {
|
if v.starts_with("0x") {
|
||||||
let n = i64::from_str_radix(&v[2..], 16);
|
if let Ok(i) = i64::from_str_radix(&v[2..], 16) {
|
||||||
if n.is_ok() {
|
return Yaml::Integer(i);
|
||||||
return Yaml::Integer(n.unwrap());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if v.starts_with("0o") {
|
if v.starts_with("0o") {
|
||||||
let n = i64::from_str_radix(&v[2..], 8);
|
if let Ok(i) = i64::from_str_radix(&v[2..], 8) {
|
||||||
if n.is_ok() {
|
return Yaml::Integer(i);
|
||||||
return Yaml::Integer(n.unwrap());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if v.starts_with('+') && v[1..].parse::<i64>().is_ok() {
|
if v.starts_with('+') {
|
||||||
return Yaml::Integer(v[1..].parse::<i64>().unwrap());
|
if let Ok(i) = v[1..].parse::<i64>() {
|
||||||
|
return Yaml::Integer(i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
match v {
|
match v {
|
||||||
"~" | "null" => Yaml::Null,
|
"~" | "null" => Yaml::Null,
|
||||||
|
|
Loading…
Reference in a new issue