Skip to content

Commit 0b31b47

Browse files
Changed applicability to MaybeIncorrect because of surrounding braces
1 parent a389c02 commit 0b31b47

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

clippy_lints/src/from_str_radix_10.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ impl LateLintPass<'tcx> for FromStrRadix10 {
6666
"This call to `from_str_radix` can be shortened to a call to str::parse",
6767
"try",
6868
format!("({}).parse()", orig_string),
69-
Applicability::MachineApplicable
69+
Applicability::MaybeIncorrect
7070
);
7171
}
7272
}

tests/ui/from_str_radix_10.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
1919
isize::from_str_radix("100", 10)?;
2020
u8::from_str_radix("7", 10)?;
2121

22+
let string = "300";
23+
i32::from_str_radix(string, 10)?;
24+
2225
// none of these should trigger the lint
2326
u16::from_str_radix("20", 3)?;
2427
i32::from_str_radix("45", 12)?;

0 commit comments

Comments
 (0)