rust-clippy/tests/ui/double_comparison.rs

31 lines
516 B
Rust
Raw Normal View History

2023-06-10 11:43:30 +00:00
#![allow(clippy::needless_if)]
2018-01-30 01:35:35 +00:00
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
}
}