mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-23 19:43:20 +00:00
24 lines
381 B
Rust
24 lines
381 B
Rust
#![warn(clippy::suspicious_unary_op_formatting)]
|
|
#![allow(clippy::needless_if)]
|
|
|
|
#[rustfmt::skip]
|
|
fn main() {
|
|
// weird binary operator formatting:
|
|
let a = 42;
|
|
|
|
if a >- 30 {}
|
|
if a >=- 30 {}
|
|
|
|
let b = true;
|
|
let c = false;
|
|
|
|
if b &&! c {}
|
|
|
|
if a >- 30 {}
|
|
|
|
// those are ok:
|
|
if a >-30 {}
|
|
if a < -30 {}
|
|
if b && !c {}
|
|
if a > - 30 {}
|
|
}
|