rust/tests/ui/double_comparison.rs

32 lines
531 B
Rust
Raw Normal View History

//@run-rustfix
2023-06-10 06:43:30 -05:00
#![allow(clippy::needless_if)]
2018-01-29 19:35:35 -06: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
}
}