1 error: this match expression is unnecessary
2 --> $DIR/needless_match.rs:16:18
4 LL | let _: i32 = match i {
11 | |_____^ help: replace it with: `i`
13 = note: `-D clippy::needless-match` implied by `-D warnings`
15 error: this match expression is unnecessary
16 --> $DIR/needless_match.rs:23:19
18 LL | let _: &str = match s {
19 | ___________________^
24 | |_____^ help: replace it with: `s`
26 error: this match expression is unnecessary
27 --> $DIR/needless_match.rs:32:21
29 LL | let _: Simple = match se {
30 | _____________________^
31 LL | | Simple::A => Simple::A,
32 LL | | Simple::B => Simple::B,
33 LL | | Simple::C => Simple::C,
34 LL | | Simple::D => Simple::D,
36 | |_____^ help: replace it with: `se`
38 error: this match expression is unnecessary
39 --> $DIR/needless_match.rs:54:26
41 LL | let _: Option<i32> = match x {
42 | __________________________^
43 LL | | Some(a) => Some(a),
46 | |_____^ help: replace it with: `x`
48 error: this match expression is unnecessary
49 --> $DIR/needless_match.rs:70:31
51 LL | let _: Result<i32, i32> = match Ok(1) {
52 | _______________________________^
53 LL | | Ok(a) => Ok(a),
54 LL | | Err(err) => Err(err),
56 | |_____^ help: replace it with: `Ok(1)`
58 error: this match expression is unnecessary
59 --> $DIR/needless_match.rs:74:31
61 LL | let _: Result<i32, i32> = match func_ret_err(0_i32) {
62 | _______________________________^
63 LL | | Err(err) => Err(err),
64 LL | | Ok(a) => Ok(a),
66 | |_____^ help: replace it with: `func_ret_err(0_i32)`
68 error: this if-let expression is unnecessary
69 --> $DIR/needless_match.rs:87:13
71 LL | let _ = if let Some(a) = Some(1) { Some(a) } else { None };
72 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `Some(1)`
74 error: this if-let expression is unnecessary
75 --> $DIR/needless_match.rs:110:31
77 LL | let _: Result<i32, i32> = if let Err(e) = x { Err(e) } else { x };
78 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `x`
80 error: this if-let expression is unnecessary
81 --> $DIR/needless_match.rs:111:31
83 LL | let _: Result<i32, i32> = if let Ok(val) = x { Ok(val) } else { x };
84 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `x`
86 error: this if-let expression is unnecessary
87 --> $DIR/needless_match.rs:117:21
89 LL | let _: Simple = if let Simple::A = x {
90 | _____________________^
92 LL | | } else if let Simple::B = x {
97 | |_____^ help: replace it with: `x`
99 error: this match expression is unnecessary
100 --> $DIR/needless_match.rs:156:26
102 LL | let _: Complex = match ce {
103 | __________________________^
104 LL | | Complex::A(a) => Complex::A(a),
105 LL | | Complex::B(a, b) => Complex::B(a, b),
106 LL | | Complex::C(a, b, c) => Complex::C(a, b, c),
107 LL | | Complex::D(E::VariantA(ea, eb), b) => Complex::D(E::VariantA(ea, eb), b),
108 LL | | Complex::D(E::VariantB(ea, eb), b) => Complex::D(E::VariantB(ea, eb), b),
110 | |_________^ help: replace it with: `ce`
112 error: aborting due to 11 previous errors