]> git.lizzy.rs Git - rust.git/blob - tests/ui/match_single_binding.fixed
Use span_lint_and_sugg + move infaillible lint
[rust.git] / tests / ui / match_single_binding.fixed
1 // run-rustfix
2
3 #![warn(clippy::match_single_binding)]
4 #[allow(clippy::many_single_char_names)]
5
6 fn main() {
7     let a = 1;
8     let b = 2;
9     let c = 3;
10     // Lint
11     let (x, y, z) = (a, b, c);
12 {
13     println!("{} {} {}", x, y, z);
14 }
15     // Ok
16     match a {
17         2 => println!("2"),
18         _ => println!("Not 2"),
19     }
20     // Ok
21     let d = Some(5);
22     match d {
23         Some(d) => println!("{}", d),
24         _ => println!("None"),
25     }
26 }