summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/double_comparison.rs
blob: 47ff87bea0ab0d91110f9d647f8e8f7600e028c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
//@run-rustfix
#![allow(clippy::needless_if)]

fn main() {
    let x = 1;
    let y = 2;
    if x == y || x < y {
        // do something
    }
    if x < y || x == y {
        // do something
    }
    if x == y || x > y {
        // do something
    }
    if x > y || x == y {
        // do something
    }
    if x < y || x > y {
        // do something
    }
    if x > y || x < y {
        // do something
    }
    if x <= y && x >= y {
        // do something
    }
    if x >= y && x <= y {
        // do something
    }
}