mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-23 14:05:27 +00:00
25 lines
582 B
Rust
25 lines
582 B
Rust
#![feature(plugin)]
|
|
|
|
#![plugin(clippy)]
|
|
#![deny(clippy)]
|
|
|
|
fn main(){
|
|
let x = Some(1u8);
|
|
match x { //~ ERROR You seem to be trying to use match
|
|
//~^ NOTE Try if let Some(y) = x { ... }
|
|
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
|
|
//~^ NOTE Try if let (2...3, 7...9) = z { ... }
|
|
(2...3, 7...9) => println!("{:?}", z),
|
|
_ => {}
|
|
}
|
|
}
|