diff --git a/tests/ui/option_map_or_none.fixed b/tests/ui/option_map_or_none.fixed index e637f973c2e..decbae4e5af 100644 --- a/tests/ui/option_map_or_none.fixed +++ b/tests/ui/option_map_or_none.fixed @@ -1,5 +1,7 @@ // run-rustfix +#![allow(clippy::option_and_then_some)] + fn main() { let opt = Some(1); diff --git a/tests/ui/option_map_or_none.rs b/tests/ui/option_map_or_none.rs index 4b9b247880a..0f1d2218d5d 100644 --- a/tests/ui/option_map_or_none.rs +++ b/tests/ui/option_map_or_none.rs @@ -1,5 +1,7 @@ // run-rustfix +#![allow(clippy::option_and_then_some)] + fn main() { let opt = Some(1); diff --git a/tests/ui/option_map_or_none.stderr b/tests/ui/option_map_or_none.stderr index 66ed1e9f045..eb5c68ed79f 100644 --- a/tests/ui/option_map_or_none.stderr +++ b/tests/ui/option_map_or_none.stderr @@ -1,5 +1,5 @@ error: called `map_or(None, f)` on an Option value. This can be done more directly by calling `and_then(f)` instead - --> $DIR/option_map_or_none.rs:8:13 + --> $DIR/option_map_or_none.rs:10:13 | LL | let _ = opt.map_or(None, |x| Some(x + 1)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using and_then instead: `opt.and_then(|x| Some(x + 1))` @@ -7,7 +7,7 @@ LL | let _ = opt.map_or(None, |x| Some(x + 1)); = note: `-D clippy::option-map-or-none` implied by `-D warnings` error: called `map_or(None, f)` on an Option value. This can be done more directly by calling `and_then(f)` instead - --> $DIR/option_map_or_none.rs:11:13 + --> $DIR/option_map_or_none.rs:13:13 | LL | let _ = opt.map_or(None, |x| { | _____________^