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