mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-30 16:39:26 +00:00
19 lines
344 B
Rust
19 lines
344 B
Rust
|
// run-rustfix
|
||
|
|
||
|
#![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);
|
||
|
}
|