mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 15:01:51 +00:00
Example for match_if_let
This commit is contained in:
parent
542bfe3570
commit
883b834068
23
examples/match_if_let.rs
Normal file
23
examples/match_if_let.rs
Normal file
@ -0,0 +1,23 @@
|
||||
#![feature(phase)]
|
||||
|
||||
#[phase(plugin)]
|
||||
extern crate rust_clippy;
|
||||
|
||||
|
||||
fn main(){
|
||||
let x = Some(1u);
|
||||
match x {
|
||||
Some(y) => println!("{}", y),
|
||||
_ => ()
|
||||
}
|
||||
// Not linted
|
||||
match x {
|
||||
Some(y) => println!("{}", y),
|
||||
None => ()
|
||||
}
|
||||
let z = (1u,1u);
|
||||
match z {
|
||||
(2...3, 7...9) => println!("{}", z),
|
||||
_ => {}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user