mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 23:20:39 +00:00
Changed applicability to MaybeIncorrect because of surrounding braces
This commit is contained in:
parent
a389c02461
commit
0b31b470ad
2 changed files with 4 additions and 1 deletions
|
@ -66,7 +66,7 @@ impl LateLintPass<'tcx> for FromStrRadix10 {
|
||||||
"This call to `from_str_radix` can be shortened to a call to str::parse",
|
"This call to `from_str_radix` can be shortened to a call to str::parse",
|
||||||
"try",
|
"try",
|
||||||
format!("({}).parse()", orig_string),
|
format!("({}).parse()", orig_string),
|
||||||
Applicability::MachineApplicable
|
Applicability::MaybeIncorrect
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,9 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
isize::from_str_radix("100", 10)?;
|
isize::from_str_radix("100", 10)?;
|
||||||
u8::from_str_radix("7", 10)?;
|
u8::from_str_radix("7", 10)?;
|
||||||
|
|
||||||
|
let string = "300";
|
||||||
|
i32::from_str_radix(string, 10)?;
|
||||||
|
|
||||||
// none of these should trigger the lint
|
// none of these should trigger the lint
|
||||||
u16::from_str_radix("20", 3)?;
|
u16::from_str_radix("20", 3)?;
|
||||||
i32::from_str_radix("45", 12)?;
|
i32::from_str_radix("45", 12)?;
|
||||||
|
|
Loading…
Reference in a new issue