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:
commit
f494f14aa6
2 changed files with 49 additions and 28 deletions
|
|
@ -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"),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue