mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-12 08:36:03 +00:00
32 lines
567 B
Rust
32 lines
567 B
Rust
#![warn(clippy::all)]
|
|
#![warn(clippy::if_not_else)]
|
|
|
|
fn foo() -> bool {
|
|
unimplemented!()
|
|
}
|
|
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");
|
|
}
|
|
if !foo() {
|
|
println!("Foo");
|
|
} else if !bla() {
|
|
println!("Bugs");
|
|
} else {
|
|
println!("Bunny");
|
|
}
|
|
}
|