Skip to content

Commit 9317ed9

Browse files
committed
Allow option_and_then_some in option_map_or_none test
1 parent a01fd4c commit 9317ed9

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

tests/ui/option_map_or_none.fixed

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// run-rustfix
22

3+
#![allow(clippy::option_and_then_some)]
4+
35
fn main() {
46
let opt = Some(1);
57

tests/ui/option_map_or_none.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// run-rustfix
22

3+
#![allow(clippy::option_and_then_some)]
4+
35
fn main() {
46
let opt = Some(1);
57

tests/ui/option_map_or_none.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error: called `map_or(None, f)` on an Option value. This can be done more directly by calling `and_then(f)` instead
2-
--> $DIR/option_map_or_none.rs:8:13
2+
--> $DIR/option_map_or_none.rs:10:13
33
|
44
LL | let _ = opt.map_or(None, |x| Some(x + 1));
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using and_then instead: `opt.and_then(|x| Some(x + 1))`
66
|
77
= note: `-D clippy::option-map-or-none` implied by `-D warnings`
88

99
error: called `map_or(None, f)` on an Option value. This can be done more directly by calling `and_then(f)` instead
10-
--> $DIR/option_map_or_none.rs:11:13
10+
--> $DIR/option_map_or_none.rs:13:13
1111
|
1212
LL | let _ = opt.map_or(None, |x| {
1313
| _____________^

0 commit comments

Comments
 (0)