You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of #3987 - phansch:rustfix_option_map_or_none, r=flip1995
Add run-rustfix for option_map_or_none lint
* Extracts `option_map_or_none` tests into separate file
* Adds `// run-rustfix` to `tests/ui/option_map_or_none.rs`
cc #3630
error: called `is_some()` after searching an `Iterator` with find. This is more succinctly expressed by calling `any()`.
185
-
--> $DIR/methods.rs:246:13
161
+
--> $DIR/methods.rs:236:13
186
162
|
187
163
LL | let _ = v.iter().find(|&x| {
188
164
| _____________^
@@ -192,15 +168,15 @@ LL | | ).is_some();
192
168
| |______________________________^
193
169
194
170
error: called `is_some()` after searching an `Iterator` with position. This is more succinctly expressed by calling `any()`.
195
-
--> $DIR/methods.rs:252:13
171
+
--> $DIR/methods.rs:242:13
196
172
|
197
173
LL | let _ = v.iter().position(|&x| x < 0).is_some();
198
174
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
199
175
|
200
176
= note: replace `position(|&x| x < 0).is_some()` with `any(|&x| x < 0)`
201
177
202
178
error: called `is_some()` after searching an `Iterator` with position. This is more succinctly expressed by calling `any()`.
203
-
--> $DIR/methods.rs:255:13
179
+
--> $DIR/methods.rs:245:13
204
180
|
205
181
LL | let _ = v.iter().position(|&x| {
206
182
| _____________^
@@ -210,15 +186,15 @@ LL | | ).is_some();
210
186
| |______________________________^
211
187
212
188
error: called `is_some()` after searching an `Iterator` with rposition. This is more succinctly expressed by calling `any()`.
213
-
--> $DIR/methods.rs:261:13
189
+
--> $DIR/methods.rs:251:13
214
190
|
215
191
LL | let _ = v.iter().rposition(|&x| x < 0).is_some();
216
192
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
217
193
|
218
194
= note: replace `rposition(|&x| x < 0).is_some()` with `any(|&x| x < 0)`
219
195
220
196
error: called `is_some()` after searching an `Iterator` with rposition. This is more succinctly expressed by calling `any()`.
221
-
--> $DIR/methods.rs:264:13
197
+
--> $DIR/methods.rs:254:13
222
198
|
223
199
LL | let _ = v.iter().rposition(|&x| {
224
200
| _____________^
@@ -228,12 +204,12 @@ LL | | ).is_some();
228
204
| |______________________________^
229
205
230
206
error: used unwrap() on an Option value. If you don't want to handle the None case gracefully, consider using expect() to provide a better panic message
231
-
--> $DIR/methods.rs:279:13
207
+
--> $DIR/methods.rs:269:13
232
208
|
233
209
LL | let _ = opt.unwrap();
234
210
| ^^^^^^^^^^^^
235
211
|
236
212
= note: `-D clippy::option-unwrap-used` implied by `-D warnings`
0 commit comments