1
1
error: this match expression is unnecessary
2
- --> $DIR/needless_match.rs:17 :18
2
+ --> $DIR/needless_match.rs:16 :18
3
3
|
4
4
LL | let _: i32 = match i {
5
5
| __________________^
@@ -13,29 +13,7 @@ LL | | };
13
13
= note: `-D clippy::needless-match` implied by `-D warnings`
14
14
15
15
error: this match expression is unnecessary
16
- --> $DIR/needless_match.rs:23:18
17
- |
18
- LL | let _: i32 = match i {
19
- | __________________^
20
- LL | | 0 => 0,
21
- LL | | 1 => 1,
22
- LL | | ref i => *i,
23
- LL | | };
24
- | |_____^ help: replace it with: `i`
25
-
26
- error: this match expression is unnecessary
27
- --> $DIR/needless_match.rs:28:22
28
- |
29
- LL | let mut _i_mut = match i {
30
- | ______________________^
31
- LL | | 0 => 0,
32
- LL | | 1 => 1,
33
- LL | | ref mut i => *i,
34
- LL | | };
35
- | |_____^ help: replace it with: `i`
36
-
37
- error: this match expression is unnecessary
38
- --> $DIR/needless_match.rs:35:19
16
+ --> $DIR/needless_match.rs:23:19
39
17
|
40
18
LL | let _: &str = match s {
41
19
| ___________________^
@@ -46,7 +24,7 @@ LL | | };
46
24
| |_____^ help: replace it with: `s`
47
25
48
26
error: this match expression is unnecessary
49
- --> $DIR/needless_match.rs:44 :21
27
+ --> $DIR/needless_match.rs:32 :21
50
28
|
51
29
LL | let _: Simple = match se {
52
30
| _____________________^
@@ -58,7 +36,7 @@ LL | | };
58
36
| |_____^ help: replace it with: `se`
59
37
60
38
error: this match expression is unnecessary
61
- --> $DIR/needless_match.rs:66 :26
39
+ --> $DIR/needless_match.rs:54 :26
62
40
|
63
41
LL | let _: Option<i32> = match x {
64
42
| __________________________^
@@ -68,7 +46,7 @@ LL | | };
68
46
| |_____^ help: replace it with: `x`
69
47
70
48
error: this match expression is unnecessary
71
- --> $DIR/needless_match.rs:82 :31
49
+ --> $DIR/needless_match.rs:70 :31
72
50
|
73
51
LL | let _: Result<i32, i32> = match Ok(1) {
74
52
| _______________________________^
@@ -78,7 +56,7 @@ LL | | };
78
56
| |_____^ help: replace it with: `Ok(1)`
79
57
80
58
error: this match expression is unnecessary
81
- --> $DIR/needless_match.rs:86 :31
59
+ --> $DIR/needless_match.rs:74 :31
82
60
|
83
61
LL | let _: Result<i32, i32> = match func_ret_err(0_i32) {
84
62
| _______________________________^
@@ -88,25 +66,25 @@ LL | | };
88
66
| |_____^ help: replace it with: `func_ret_err(0_i32)`
89
67
90
68
error: this if-let expression is unnecessary
91
- --> $DIR/needless_match.rs:93 :5
69
+ --> $DIR/needless_match.rs:87 :5
92
70
|
93
71
LL | if let Some(a) = Some(1) { Some(a) } else { None }
94
72
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `Some(1)`
95
73
96
74
error: this if-let expression is unnecessary
97
- --> $DIR/needless_match.rs:97:30
75
+ --> $DIR/needless_match.rs:92:31
98
76
|
99
- LL | let _: Result<() , i32> = if let Err(e) = x { Err(e) } else { x };
100
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `x`
77
+ LL | let _: Result<i32 , i32> = if let Err(e) = x { Err(e) } else { x };
78
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `x`
101
79
102
80
error: this if-let expression is unnecessary
103
- --> $DIR/needless_match.rs:98:30
81
+ --> $DIR/needless_match.rs:93:31
104
82
|
105
- LL | let _: Result<() , i32> = if let Ok(val) = x { Ok(val) } else { x };
106
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `x`
83
+ LL | let _: Result<i32 , i32> = if let Ok(val) = x { Ok(val) } else { x };
84
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `x`
107
85
108
86
error: this if-let expression is unnecessary
109
- --> $DIR/needless_match.rs:104 :21
87
+ --> $DIR/needless_match.rs:99 :21
110
88
|
111
89
LL | let _: Simple = if let Simple::A = x {
112
90
| _____________________^
@@ -119,7 +97,7 @@ LL | | };
119
97
| |_____^ help: replace it with: `x`
120
98
121
99
error: this match expression is unnecessary
122
- --> $DIR/needless_match.rs:143 :26
100
+ --> $DIR/needless_match.rs:138 :26
123
101
|
124
102
LL | let _: Complex = match ce {
125
103
| __________________________^
@@ -131,5 +109,5 @@ LL | | Complex::D(E::VariantB(ea, eb), b) => Complex::D(E::VariantB(
131
109
LL | | };
132
110
| |_________^ help: replace it with: `ce`
133
111
134
- error: aborting due to 13 previous errors
112
+ error: aborting due to 11 previous errors
135
113
0 commit comments