rust/tests/ui/match_single_binding.rs
ThibsG 6afd7ea147 Use span_lint_and_sugg + move infaillible lint
- moving infaillible lint to prevent collisions
2020-02-04 22:49:08 +01:00

28 lines
483 B
Rust

// run-rustfix
#![warn(clippy::match_single_binding)]
#[allow(clippy::many_single_char_names)]
fn main() {
let a = 1;
let b = 2;
let c = 3;
// Lint
match (a, b, c) {
(x, y, z) => {
println!("{} {} {}", x, y, z);
},
}
// Ok
match a {
2 => println!("2"),
_ => println!("Not 2"),
}
// Ok
let d = Some(5);
match d {
Some(d) => println!("{}", d),
_ => println!("None"),
}
}