1 error: this match expression is unnecessary
2 --> $DIR/needless_match.rs:17: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:18
18 LL | let _: i32 = match i {
24 | |_____^ help: replace it with: `i`
26 error: this match expression is unnecessary
27 --> $DIR/needless_match.rs:28:22
29 LL | let mut _i_mut = match i {
30 | ______________________^
33 LL | | ref mut i => *i,
35 | |_____^ help: replace it with: `i`
37 error: this match expression is unnecessary
38 --> $DIR/needless_match.rs:35:19
40 LL | let _: &str = match s {
41 | ___________________^
46 | |_____^ help: replace it with: `s`
48 error: this match expression is unnecessary
49 --> $DIR/needless_match.rs:43:21
51 LL | let _: Choice = match se {
52 | _____________________^
53 LL | | Choice::A => Choice::A,
54 LL | | Choice::B => Choice::B,
55 LL | | Choice::C => Choice::C,
56 LL | | Choice::D => Choice::D,
58 | |_____^ help: replace it with: `se`
60 error: this match expression is unnecessary
61 --> $DIR/needless_match.rs:65:26
63 LL | let _: Option<i32> = match x {
64 | __________________________^
65 LL | | Some(a) => Some(a),
68 | |_____^ help: replace it with: `x`
70 error: this match expression is unnecessary
71 --> $DIR/needless_match.rs:81:31
73 LL | let _: Result<i32, i32> = match Ok(1) {
74 | _______________________________^
75 LL | | Ok(a) => Ok(a),
76 LL | | Err(err) => Err(err),
78 | |_____^ help: replace it with: `Ok(1)`
80 error: this match expression is unnecessary
81 --> $DIR/needless_match.rs:85:31
83 LL | let _: Result<i32, i32> = match func_ret_err(0_i32) {
84 | _______________________________^
85 LL | | Err(err) => Err(err),
86 LL | | Ok(a) => Ok(a),
88 | |_____^ help: replace it with: `func_ret_err(0_i32)`
90 error: this if-let expression is unnecessary
91 --> $DIR/needless_match.rs:92:5
93 LL | if let Some(a) = Some(1) { Some(a) } else { None }
94 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `Some(1)`
96 error: this if-let expression is unnecessary
97 --> $DIR/needless_match.rs:96:30
99 LL | let _: Result<(), i32> = if let Err(e) = x { Err(e) } else { x };
100 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `x`
102 error: this if-let expression is unnecessary
103 --> $DIR/needless_match.rs:97:30
105 LL | let _: Result<(), i32> = if let Ok(val) = x { Ok(val) } else { x };
106 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `x`
108 error: this if-let expression is unnecessary
109 --> $DIR/needless_match.rs:103:21
111 LL | let _: Choice = if let Choice::A = x {
112 | _____________________^
114 LL | | } else if let Choice::B = x {
119 | |_____^ help: replace it with: `x`
121 error: aborting due to 12 previous errors