2016-02-09 19:10:22 +00:00
|
|
|
#![feature(plugin)]
|
|
|
|
#![plugin(clippy)]
|
|
|
|
|
|
|
|
#[deny(bool_comparison)]
|
|
|
|
fn main() {
|
|
|
|
let x = true;
|
2016-02-09 19:44:42 +00:00
|
|
|
if x == true { "yes" } else { "no" };
|
2016-02-09 20:44:07 +00:00
|
|
|
//~^ ERROR equality checks against true are unnecesary
|
|
|
|
//~| HELP try simplifying it as shown:
|
|
|
|
//~| SUGGESTION if x { "yes" } else { "no" };
|
2016-02-09 19:44:42 +00:00
|
|
|
if x == false { "yes" } else { "no" };
|
2016-02-09 20:44:07 +00:00
|
|
|
//~^ ERROR equality checks against false can be replaced by a negation
|
|
|
|
//~| HELP try simplifying it as shown:
|
|
|
|
//~| SUGGESTION if !x { "yes" } else { "no" };
|
2016-02-09 19:44:42 +00:00
|
|
|
if true == x { "yes" } else { "no" };
|
2016-02-09 20:44:07 +00:00
|
|
|
//~^ ERROR equality checks against true are unnecesary
|
|
|
|
//~| HELP try simplifying it as shown:
|
|
|
|
//~| SUGGESTION if x { "yes" } else { "no" };
|
2016-02-09 19:44:42 +00:00
|
|
|
if false == x { "yes" } else { "no" };
|
2016-02-09 20:44:07 +00:00
|
|
|
//~^ ERROR equality checks against false can be replaced by a negation
|
|
|
|
//~| HELP try simplifying it as shown:
|
|
|
|
//~| SUGGESTION if !x { "yes" } else { "no" };
|
2016-02-09 19:10:22 +00:00
|
|
|
}
|