mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-10 15:14:29 +00:00
16 lines
312 B
Rust
16 lines
312 B
Rust
#![warn(clippy::is_digit_ascii_radix)]
|
|
|
|
const TEN: u32 = 10;
|
|
|
|
fn main() {
|
|
let c: char = '6';
|
|
|
|
// Should trigger the lint.
|
|
let _ = c.is_digit(10);
|
|
let _ = c.is_digit(16);
|
|
let _ = c.is_digit(0x10);
|
|
|
|
// Should not trigger the lint.
|
|
let _ = c.is_digit(11);
|
|
let _ = c.is_digit(TEN);
|
|
}
|