2015-04-13 17:58:18 +00:00
|
|
|
#![feature(plugin)]
|
|
|
|
|
|
|
|
#![plugin(clippy)]
|
|
|
|
#![deny(clippy)]
|
|
|
|
|
|
|
|
fn main(){
|
|
|
|
let x = Some(1u8);
|
|
|
|
match x { //~ ERROR You seem to be trying to use match
|
2015-08-11 13:07:21 +00:00
|
|
|
//~^ HELP Try if let Some(y) = x { ... }
|
2015-04-13 17:58:18 +00:00
|
|
|
Some(y) => println!("{:?}", y),
|
|
|
|
_ => ()
|
|
|
|
}
|
|
|
|
// Not linted
|
|
|
|
match x {
|
|
|
|
Some(y) => println!("{:?}", y),
|
|
|
|
None => ()
|
|
|
|
}
|
|
|
|
let z = (1u8,1u8);
|
|
|
|
match z { //~ ERROR You seem to be trying to use match
|
2015-08-11 13:07:21 +00:00
|
|
|
//~^ HELP Try if let (2...3, 7...9) = z { ... }
|
2015-04-13 17:58:18 +00:00
|
|
|
(2...3, 7...9) => println!("{:?}", z),
|
|
|
|
_ => {}
|
|
|
|
}
|
|
|
|
}
|