1
1
error: redundant pattern matching, consider using `is_none()`
2
- --> $DIR/redundant_pattern_matching_option.rs:8 :12
2
+ --> $DIR/redundant_pattern_matching_option.rs:13 :12
3
3
|
4
4
LL | if let None = None::<()> {}
5
5
| -------^^^^------------- help: try this: `if None::<()>.is_none()`
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_some()`
10
- --> $DIR/redundant_pattern_matching_option.rs:10 :12
10
+ --> $DIR/redundant_pattern_matching_option.rs:15 :12
11
11
|
12
12
LL | if let Some(_) = Some(42) {}
13
13
| -------^^^^^^^----------- help: try this: `if Some(42).is_some()`
14
14
15
15
error: redundant pattern matching, consider using `is_some()`
16
- --> $DIR/redundant_pattern_matching_option.rs:12 :12
16
+ --> $DIR/redundant_pattern_matching_option.rs:17 :12
17
17
|
18
18
LL | if let Some(_) = Some(42) {
19
19
| -------^^^^^^^----------- help: try this: `if Some(42).is_some()`
20
20
21
21
error: redundant pattern matching, consider using `is_some()`
22
- --> $DIR/redundant_pattern_matching_option.rs:18 :15
22
+ --> $DIR/redundant_pattern_matching_option.rs:23 :15
23
23
|
24
24
LL | while let Some(_) = Some(42) {}
25
25
| ----------^^^^^^^----------- help: try this: `while Some(42).is_some()`
26
26
27
27
error: redundant pattern matching, consider using `is_none()`
28
- --> $DIR/redundant_pattern_matching_option.rs:20 :15
28
+ --> $DIR/redundant_pattern_matching_option.rs:25 :15
29
29
|
30
30
LL | while let None = Some(42) {}
31
31
| ----------^^^^----------- help: try this: `while Some(42).is_none()`
32
32
33
33
error: redundant pattern matching, consider using `is_none()`
34
- --> $DIR/redundant_pattern_matching_option.rs:22 :15
34
+ --> $DIR/redundant_pattern_matching_option.rs:27 :15
35
35
|
36
36
LL | while let None = None::<()> {}
37
37
| ----------^^^^------------- help: try this: `while None::<()>.is_none()`
38
38
39
39
error: redundant pattern matching, consider using `is_some()`
40
- --> $DIR/redundant_pattern_matching_option.rs:25 :15
40
+ --> $DIR/redundant_pattern_matching_option.rs:30 :15
41
41
|
42
42
LL | while let Some(_) = v.pop() {
43
43
| ----------^^^^^^^---------- help: try this: `while v.pop().is_some()`
44
44
45
45
error: redundant pattern matching, consider using `is_some()`
46
- --> $DIR/redundant_pattern_matching_option.rs:33 :5
46
+ --> $DIR/redundant_pattern_matching_option.rs:38 :5
47
47
|
48
48
LL | / match Some(42) {
49
49
LL | | Some(_) => true,
@@ -52,7 +52,7 @@ LL | | };
52
52
| |_____^ help: try this: `Some(42).is_some()`
53
53
54
54
error: redundant pattern matching, consider using `is_none()`
55
- --> $DIR/redundant_pattern_matching_option.rs:38 :5
55
+ --> $DIR/redundant_pattern_matching_option.rs:43 :5
56
56
|
57
57
LL | / match None::<()> {
58
58
LL | | Some(_) => false,
@@ -61,7 +61,7 @@ LL | | };
61
61
| |_____^ help: try this: `None::<()>.is_none()`
62
62
63
63
error: redundant pattern matching, consider using `is_none()`
64
- --> $DIR/redundant_pattern_matching_option.rs:43 :13
64
+ --> $DIR/redundant_pattern_matching_option.rs:48 :13
65
65
|
66
66
LL | let _ = match None::<()> {
67
67
| _____________^
@@ -71,25 +71,25 @@ LL | | };
71
71
| |_____^ help: try this: `None::<()>.is_none()`
72
72
73
73
error: redundant pattern matching, consider using `is_some()`
74
- --> $DIR/redundant_pattern_matching_option.rs:49 :20
74
+ --> $DIR/redundant_pattern_matching_option.rs:54 :20
75
75
|
76
76
LL | let _ = if let Some(_) = opt { true } else { false };
77
77
| -------^^^^^^^------ help: try this: `if opt.is_some()`
78
78
79
79
error: redundant pattern matching, consider using `is_some()`
80
- --> $DIR/redundant_pattern_matching_option.rs:53 :20
80
+ --> $DIR/redundant_pattern_matching_option.rs:58 :20
81
81
|
82
82
LL | let _ = if let Some(_) = gen_opt() {
83
83
| -------^^^^^^^------------ help: try this: `if gen_opt().is_some()`
84
84
85
85
error: redundant pattern matching, consider using `is_none()`
86
- --> $DIR/redundant_pattern_matching_option.rs:55 :19
86
+ --> $DIR/redundant_pattern_matching_option.rs:60 :19
87
87
|
88
88
LL | } else if let None = gen_opt() {
89
89
| -------^^^^------------ help: try this: `if gen_opt().is_none()`
90
90
91
91
error: redundant pattern matching, consider using `is_some()`
92
- --> $DIR/redundant_pattern_matching_option.rs:64 :12
92
+ --> $DIR/redundant_pattern_matching_option.rs:69 :12
93
93
|
94
94
LL | if let Some(_) = Some(m.lock()) {}
95
95
| -------^^^^^^^----------------- help: try this: `if Some(m.lock()).is_some()`
@@ -98,7 +98,7 @@ LL | if let Some(_) = Some(m.lock()) {}
98
98
= note: add `#[allow(clippy::redundant_pattern_matching)]` if this is important
99
99
100
100
error: redundant pattern matching, consider using `is_some()`
101
- --> $DIR/redundant_pattern_matching_option.rs:65 :12
101
+ --> $DIR/redundant_pattern_matching_option.rs:70 :12
102
102
|
103
103
LL | if let Some(_) = Some(m.lock().unwrap().0) {}
104
104
| -------^^^^^^^---------------------------- help: try this: `if Some(m.lock().unwrap().0).is_some()`
@@ -107,7 +107,7 @@ LL | if let Some(_) = Some(m.lock().unwrap().0) {}
107
107
= note: add `#[allow(clippy::redundant_pattern_matching)]` if this is important
108
108
109
109
error: redundant pattern matching, consider using `is_none()`
110
- --> $DIR/redundant_pattern_matching_option.rs:68 :16
110
+ --> $DIR/redundant_pattern_matching_option.rs:73 :16
111
111
|
112
112
LL | if let None = None::<std::sync::MutexGuard<()>> {}
113
113
| -------^^^^------------------------------------ help: try this: `if None::<std::sync::MutexGuard<()>>.is_none()`
@@ -116,7 +116,7 @@ LL | if let None = None::<std::sync::MutexGuard<()>> {}
116
116
= note: add `#[allow(clippy::redundant_pattern_matching)]` if this is important
117
117
118
118
error: redundant pattern matching, consider using `is_none()`
119
- --> $DIR/redundant_pattern_matching_option.rs:70 :12
119
+ --> $DIR/redundant_pattern_matching_option.rs:75 :12
120
120
|
121
121
LL | if let None = None::<std::sync::MutexGuard<()>> {
122
122
| -------^^^^------------------------------------ help: try this: `if None::<std::sync::MutexGuard<()>>.is_none()`
@@ -125,49 +125,49 @@ LL | if let None = None::<std::sync::MutexGuard<()>> {
125
125
= note: add `#[allow(clippy::redundant_pattern_matching)]` if this is important
126
126
127
127
error: redundant pattern matching, consider using `is_none()`
128
- --> $DIR/redundant_pattern_matching_option.rs:74 :12
128
+ --> $DIR/redundant_pattern_matching_option.rs:79 :12
129
129
|
130
130
LL | if let None = None::<std::sync::MutexGuard<()>> {}
131
131
| -------^^^^------------------------------------ help: try this: `if None::<std::sync::MutexGuard<()>>.is_none()`
132
132
133
133
error: redundant pattern matching, consider using `is_some()`
134
- --> $DIR/redundant_pattern_matching_option.rs:76 :12
134
+ --> $DIR/redundant_pattern_matching_option.rs:81 :12
135
135
|
136
136
LL | if let Some(_) = Some(String::new()) {}
137
137
| -------^^^^^^^---------------------- help: try this: `if Some(String::new()).is_some()`
138
138
139
139
error: redundant pattern matching, consider using `is_some()`
140
- --> $DIR/redundant_pattern_matching_option.rs:77 :12
140
+ --> $DIR/redundant_pattern_matching_option.rs:82 :12
141
141
|
142
142
LL | if let Some(_) = Some((String::new(), ())) {}
143
143
| -------^^^^^^^---------------------------- help: try this: `if Some((String::new(), ())).is_some()`
144
144
145
145
error: redundant pattern matching, consider using `is_some()`
146
- --> $DIR/redundant_pattern_matching_option.rs:92 :12
146
+ --> $DIR/redundant_pattern_matching_option.rs:97 :12
147
147
|
148
148
LL | if let Some(_) = Some(42) {}
149
149
| -------^^^^^^^----------- help: try this: `if Some(42).is_some()`
150
150
151
151
error: redundant pattern matching, consider using `is_none()`
152
- --> $DIR/redundant_pattern_matching_option.rs:94 :12
152
+ --> $DIR/redundant_pattern_matching_option.rs:99 :12
153
153
|
154
154
LL | if let None = None::<()> {}
155
155
| -------^^^^------------- help: try this: `if None::<()>.is_none()`
156
156
157
157
error: redundant pattern matching, consider using `is_some()`
158
- --> $DIR/redundant_pattern_matching_option.rs:96 :15
158
+ --> $DIR/redundant_pattern_matching_option.rs:101 :15
159
159
|
160
160
LL | while let Some(_) = Some(42) {}
161
161
| ----------^^^^^^^----------- help: try this: `while Some(42).is_some()`
162
162
163
163
error: redundant pattern matching, consider using `is_none()`
164
- --> $DIR/redundant_pattern_matching_option.rs:98 :15
164
+ --> $DIR/redundant_pattern_matching_option.rs:103 :15
165
165
|
166
166
LL | while let None = None::<()> {}
167
167
| ----------^^^^------------- help: try this: `while None::<()>.is_none()`
168
168
169
169
error: redundant pattern matching, consider using `is_some()`
170
- --> $DIR/redundant_pattern_matching_option.rs:100 :5
170
+ --> $DIR/redundant_pattern_matching_option.rs:105 :5
171
171
|
172
172
LL | / match Some(42) {
173
173
LL | | Some(_) => true,
@@ -176,7 +176,7 @@ LL | | };
176
176
| |_____^ help: try this: `Some(42).is_some()`
177
177
178
178
error: redundant pattern matching, consider using `is_none()`
179
- --> $DIR/redundant_pattern_matching_option.rs:105 :5
179
+ --> $DIR/redundant_pattern_matching_option.rs:110 :5
180
180
|
181
181
LL | / match None::<()> {
182
182
LL | | Some(_) => false,
0 commit comments