clippy 0.0.6

A bunch of helpful lints to avoid common pitfalls in Rust
1
2
3
4
5
6
7
8
9
10
11
12
#![feature(plugin)]
#![plugin(clippy)]

#[deny(needless_bool)]
fn main() {
	let x = true;
	if x { true } else { true }; //~ERROR 
	if x { false } else { false }; //~ERROR
	if x { true } else { false }; //~ERROR
	if x { false } else { true }; //~ERROR
	if x { x } else { false }; // would also be questionable, but we don't catch this yet
}