mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 21:23:56 +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",
|
||||
"try",
|
||||
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)?;
|
||||
u8::from_str_radix("7", 10)?;
|
||||
|
||||
let string = "300";
|
||||
i32::from_str_radix(string, 10)?;
|
||||
|
||||
// none of these should trigger the lint
|
||||
u16::from_str_radix("20", 3)?;
|
||||
i32::from_str_radix("45", 12)?;
|
||||
|
|
Loading…
Reference in a new issue