rust-clippy/tests/ui/bool_comparison.rs

12 lines
261 B
Rust
Raw Normal View History

2018-07-28 15:34:52 +00:00
#![feature(tool_lints)]
2017-09-18 10:47:33 +00:00
2018-07-28 15:34:52 +00:00
#[warn(clippy::bool_comparison)]
fn main() {
let x = true;
if x == true { "yes" } else { "no" };
if x == false { "yes" } else { "no" };
if true == x { "yes" } else { "no" };
if false == x { "yes" } else { "no" };
}