2
0
Fork 0
mirror of https://github.com/rust-lang/rust-clippy synced 2025-01-02 16:29:10 +00:00
rust-clippy/tests/ui/short_circuit_statement.fixed

19 lines
234 B
Rust
Raw Normal View History

// 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
}