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

27 lines
448 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
let (x, y, z) = (a, b, c);
{
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"),
}
}