mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-22 02:53:20 +00:00
13ad14b22d
When inverting an expression, the output is now like ```foo != 0``` instead of ```!(foo == 0)```, the comparison operator is now replaced.
18 lines
231 B
Rust
18 lines
231 B
Rust
// run-rustfix
|
|
|
|
#![warn(clippy::short_circuit_statement)]
|
|
#![allow(clippy::nonminimal_bool)]
|
|
|
|
fn main() {
|
|
if f() { g(); }
|
|
if !f() { g(); }
|
|
if 1 != 2 { g(); }
|
|
}
|
|
|
|
fn f() -> bool {
|
|
true
|
|
}
|
|
|
|
fn g() -> bool {
|
|
false
|
|
}
|