@@ -2,30 +2,72 @@ error: redundant pattern matching, consider using `is_ok()`
2
2
--> $DIR/redundant_pattern_matching.rs:8:12
3
3
|
4
4
LL | if let Ok(_) = Ok::<i32, i32>(42) {}
5
- | -------^^^^^------------------------ help: try this: `Ok::<i32, i32>(42).is_ok(); `
5
+ | -------^^^^^--------------------- help: try this: `if Ok::<i32, i32>(42).is_ok()`
6
6
|
7
7
= note: `-D clippy::redundant-pattern-matching` implied by `-D warnings`
8
8
9
9
error: redundant pattern matching, consider using `is_err()`
10
10
--> $DIR/redundant_pattern_matching.rs:10:12
11
11
|
12
12
LL | if let Err(_) = Err::<i32, i32>(42) {}
13
- | -------^^^^^^------------------------- help: try this: `Err::<i32, i32>(42).is_err(); `
13
+ | -------^^^^^^---------------------- help: try this: `if Err::<i32, i32>(42).is_err()`
14
14
15
15
error: redundant pattern matching, consider using `is_none()`
16
16
--> $DIR/redundant_pattern_matching.rs:12:12
17
17
|
18
18
LL | if let None = None::<()> {}
19
- | -------^^^^---------------- help: try this: `None::<()>.is_none(); `
19
+ | -------^^^^------------- help: try this: `if None::<()>.is_none()`
20
20
21
21
error: redundant pattern matching, consider using `is_some()`
22
22
--> $DIR/redundant_pattern_matching.rs:14:12
23
23
|
24
24
LL | if let Some(_) = Some(42) {}
25
- | -------^^^^^^^-------------- help: try this: `Some(42).is_some();`
25
+ | -------^^^^^^^----------- help: try this: `if Some(42).is_some()`
26
+
27
+ error: redundant pattern matching, consider using `is_some()`
28
+ --> $DIR/redundant_pattern_matching.rs:16:12
29
+ |
30
+ LL | if let Some(_) = Some(42) {
31
+ | -------^^^^^^^----------- help: try this: `if Some(42).is_some()`
32
+
33
+ error: redundant pattern matching, consider using `is_some()`
34
+ --> $DIR/redundant_pattern_matching.rs:22:15
35
+ |
36
+ LL | while let Some(_) = Some(42) {}
37
+ | ----------^^^^^^^----------- help: try this: `while Some(42).is_some()`
38
+
39
+ error: redundant pattern matching, consider using `is_none()`
40
+ --> $DIR/redundant_pattern_matching.rs:24:15
41
+ |
42
+ LL | while let None = Some(42) {}
43
+ | ----------^^^^----------- help: try this: `while Some(42).is_none()`
44
+
45
+ error: redundant pattern matching, consider using `is_none()`
46
+ --> $DIR/redundant_pattern_matching.rs:26:15
47
+ |
48
+ LL | while let None = None::<()> {}
49
+ | ----------^^^^------------- help: try this: `while None::<()>.is_none()`
26
50
27
51
error: redundant pattern matching, consider using `is_ok()`
28
- --> $DIR/redundant_pattern_matching.rs:28:5
52
+ --> $DIR/redundant_pattern_matching.rs:28:15
53
+ |
54
+ LL | while let Ok(_) = Ok::<i32, i32>(10) {}
55
+ | ----------^^^^^--------------------- help: try this: `while Ok::<i32, i32>(10).is_ok()`
56
+
57
+ error: redundant pattern matching, consider using `is_err()`
58
+ --> $DIR/redundant_pattern_matching.rs:30:15
59
+ |
60
+ LL | while let Err(_) = Ok::<i32, i32>(10) {}
61
+ | ----------^^^^^^--------------------- help: try this: `while Ok::<i32, i32>(10).is_err()`
62
+
63
+ error: redundant pattern matching, consider using `is_some()`
64
+ --> $DIR/redundant_pattern_matching.rs:33:15
65
+ |
66
+ LL | while let Some(_) = v.pop() {
67
+ | ----------^^^^^^^---------- help: try this: `while v.pop().is_some()`
68
+
69
+ error: redundant pattern matching, consider using `is_ok()`
70
+ --> $DIR/redundant_pattern_matching.rs:49:5
29
71
|
30
72
LL | / match Ok::<i32, i32>(42) {
31
73
LL | | Ok(_) => true,
@@ -34,7 +76,7 @@ LL | | };
34
76
| |_____^ help: try this: `Ok::<i32, i32>(42).is_ok()`
35
77
36
78
error: redundant pattern matching, consider using `is_err()`
37
- --> $DIR/redundant_pattern_matching.rs:33 :5
79
+ --> $DIR/redundant_pattern_matching.rs:54 :5
38
80
|
39
81
LL | / match Ok::<i32, i32>(42) {
40
82
LL | | Ok(_) => false,
@@ -43,7 +85,7 @@ LL | | };
43
85
| |_____^ help: try this: `Ok::<i32, i32>(42).is_err()`
44
86
45
87
error: redundant pattern matching, consider using `is_err()`
46
- --> $DIR/redundant_pattern_matching.rs:38 :5
88
+ --> $DIR/redundant_pattern_matching.rs:59 :5
47
89
|
48
90
LL | / match Err::<i32, i32>(42) {
49
91
LL | | Ok(_) => false,
@@ -52,7 +94,7 @@ LL | | };
52
94
| |_____^ help: try this: `Err::<i32, i32>(42).is_err()`
53
95
54
96
error: redundant pattern matching, consider using `is_ok()`
55
- --> $DIR/redundant_pattern_matching.rs:43 :5
97
+ --> $DIR/redundant_pattern_matching.rs:64 :5
56
98
|
57
99
LL | / match Err::<i32, i32>(42) {
58
100
LL | | Ok(_) => true,
@@ -61,7 +103,7 @@ LL | | };
61
103
| |_____^ help: try this: `Err::<i32, i32>(42).is_ok()`
62
104
63
105
error: redundant pattern matching, consider using `is_some()`
64
- --> $DIR/redundant_pattern_matching.rs:48 :5
106
+ --> $DIR/redundant_pattern_matching.rs:69 :5
65
107
|
66
108
LL | / match Some(42) {
67
109
LL | | Some(_) => true,
@@ -70,7 +112,7 @@ LL | | };
70
112
| |_____^ help: try this: `Some(42).is_some()`
71
113
72
114
error: redundant pattern matching, consider using `is_none()`
73
- --> $DIR/redundant_pattern_matching.rs:53 :5
115
+ --> $DIR/redundant_pattern_matching.rs:74 :5
74
116
|
75
117
LL | / match None::<()> {
76
118
LL | | Some(_) => false,
@@ -79,7 +121,7 @@ LL | | };
79
121
| |_____^ help: try this: `None::<()>.is_none()`
80
122
81
123
error: redundant pattern matching, consider using `is_none()`
82
- --> $DIR/redundant_pattern_matching.rs:58 :13
124
+ --> $DIR/redundant_pattern_matching.rs:79 :13
83
125
|
84
126
LL | let _ = match None::<()> {
85
127
| _____________^
@@ -89,38 +131,28 @@ LL | | };
89
131
| |_____^ help: try this: `None::<()>.is_none()`
90
132
91
133
error: redundant pattern matching, consider using `is_ok()`
92
- --> $DIR/redundant_pattern_matching.rs:63 :20
134
+ --> $DIR/redundant_pattern_matching.rs:84 :20
93
135
|
94
136
LL | let _ = if let Ok(_) = Ok::<usize, ()>(4) { true } else { false };
95
- | -------^^^^^--------------------------------------------- help: try this: `Ok::<usize, ()>(4).is_ok()`
137
+ | -------^^^^^--------------------- help: try this: `if Ok::<usize, ()>(4).is_ok()`
96
138
97
139
error: redundant pattern matching, consider using `is_some()`
98
- --> $DIR/redundant_pattern_matching.rs:69 :20
140
+ --> $DIR/redundant_pattern_matching.rs:90 :20
99
141
|
100
142
LL | let x = if let Some(_) = opt { true } else { false };
101
- | -------^^^^^^^------------------------------ help: try this: `opt.is_some()`
143
+ | -------^^^^^^^------ help: try this: `if opt.is_some()`
102
144
103
145
error: redundant pattern matching, consider using `is_ok()`
104
- --> $DIR/redundant_pattern_matching.rs:76 :12
146
+ --> $DIR/redundant_pattern_matching.rs:101 :12
105
147
|
106
- LL | if let Ok(_) = Ok::<i32, i32>(4) {
107
- | _____- ^^^^^
108
- LL | | true
109
- LL | | } else {
110
- LL | | false
111
- LL | | }
112
- | |_____- help: try this: `Ok::<i32, i32>(4).is_ok()`
148
+ LL | if let Ok(_) = Ok::<i32, i32>(4) {
149
+ | -------^^^^^-------------------- help: try this: `if Ok::<i32, i32>(4).is_ok()`
113
150
114
151
error: redundant pattern matching, consider using `is_ok()`
115
- --> $DIR/redundant_pattern_matching.rs:84 :12
152
+ --> $DIR/redundant_pattern_matching.rs:109 :12
116
153
|
117
- LL | if let Ok(_) = Ok::<i32, i32>(4) {
118
- | _____- ^^^^^
119
- LL | | true
120
- LL | | } else {
121
- LL | | false
122
- LL | | };
123
- | |_____- help: try this: `Ok::<i32, i32>(4).is_ok()`
154
+ LL | if let Ok(_) = Ok::<i32, i32>(4) {
155
+ | -------^^^^^-------------------- help: try this: `if Ok::<i32, i32>(4).is_ok()`
124
156
125
- error: aborting due to 15 previous errors
157
+ error: aborting due to 22 previous errors
126
158
0 commit comments