2018-07-28 17:34:52 +02:00
|
|
|
#![warn(clippy::all)]
|
|
|
|
#![warn(clippy::if_not_else)]
|
2016-02-29 09:45:36 +01:00
|
|
|
|
2021-11-04 12:52:36 +00:00
|
|
|
fn foo() -> bool {
|
|
|
|
unimplemented!()
|
|
|
|
}
|
2018-12-09 23:26:16 +01:00
|
|
|
fn bla() -> bool {
|
|
|
|
unimplemented!()
|
|
|
|
}
|
2016-02-29 09:45:36 +01:00
|
|
|
|
|
|
|
fn main() {
|
2017-02-08 14:58:07 +01:00
|
|
|
if !bla() {
|
2023-08-24 21:32:12 +02:00
|
|
|
//~^ ERROR: unnecessary boolean `not` operation
|
2016-02-29 09:45:36 +01:00
|
|
|
println!("Bugs");
|
|
|
|
} else {
|
|
|
|
println!("Bunny");
|
|
|
|
}
|
2017-02-08 14:58:07 +01:00
|
|
|
if 4 != 5 {
|
2023-08-24 21:32:12 +02:00
|
|
|
//~^ ERROR: unnecessary `!=` operation
|
2016-02-29 09:45:36 +01:00
|
|
|
println!("Bugs");
|
|
|
|
} else {
|
|
|
|
println!("Bunny");
|
|
|
|
}
|
2021-11-04 12:52:36 +00:00
|
|
|
if !foo() {
|
|
|
|
println!("Foo");
|
|
|
|
} else if !bla() {
|
|
|
|
println!("Bugs");
|
|
|
|
} else {
|
|
|
|
println!("Bunny");
|
|
|
|
}
|
2016-02-29 09:45:36 +01:00
|
|
|
}
|