rust/tests/ui/bool_comparison.rs

24 lines
279 B
Rust
Raw Normal View History

#![feature(plugin)]
#![plugin(clippy)]
#[deny(bool_comparison)]
fn main() {
let x = true;
if x == true { "yes" } else { "no" };
2017-02-08 07:58:07 -06:00
if x == false { "yes" } else { "no" };
2017-02-08 07:58:07 -06:00
if true == x { "yes" } else { "no" };
2017-02-08 07:58:07 -06:00
if false == x { "yes" } else { "no" };
2017-02-08 07:58:07 -06:00
}