Merge pull request #177 from birkenfeld/if_let_mini_fix

misc: fix check for unit body in "match -> if let" lint (fixes #172)
This commit is contained in:
Manish Goregaokar 2015-08-15 14:12:34 +05:30
commit f494f14aa6
2 changed files with 49 additions and 28 deletions

View file

@ -23,4 +23,16 @@ fn main(){
(2...3, 7...9) => println!("{:?}", z),
_ => {}
}
// Not linted (pattern guards used)
match x {
Some(y) if y == 0 => println!("{:?}", y),
_ => ()
}
// Not linted (content in the else)
match z {
(2...3, 7...9) => println!("{:?}", z),
_ => println!("nope"),
}
}