rust-clippy/tests/ui/if_not_else.rs
2017-02-07 21:05:30 +01:00

19 lines
393 B
Rust

#![feature(plugin)]
#![plugin(clippy)]
#![deny(clippy)]
#![deny(if_not_else)]
fn bla() -> bool { unimplemented!() }
fn main() {
if !bla() { //~ ERROR: Unnecessary boolean `not` operation
println!("Bugs");
} else {
println!("Bunny");
}
if 4 != 5 { //~ ERROR: Unnecessary `!=` operation
println!("Bugs");
} else {
println!("Bunny");
}
}