2023-04-23 06:03:09 -05:00
|
|
|
//@run-rustfix
|
2022-05-05 09:12:52 -05:00
|
|
|
|
|
|
|
#![warn(clippy::is_digit_ascii_radix)]
|
|
|
|
|
|
|
|
const TEN: u32 = 10;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let c: char = '6';
|
|
|
|
|
|
|
|
// Should trigger the lint.
|
|
|
|
let _ = c.is_ascii_digit();
|
|
|
|
let _ = c.is_ascii_hexdigit();
|
|
|
|
let _ = c.is_ascii_hexdigit();
|
|
|
|
|
|
|
|
// Should not trigger the lint.
|
|
|
|
let _ = c.is_digit(11);
|
|
|
|
let _ = c.is_digit(TEN);
|
|
|
|
}
|