summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/is_digit_ascii_radix.rs
blob: 68e3f3243d96dabb8f47af2cd321a3ad04d66989 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// 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_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);
}