mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 07:44:10 +00:00
Allow option_and_then_some in option_map_or_none test
This commit is contained in:
parent
7065239da5
commit
50ecd595a6
@ -1,5 +1,7 @@
|
||||
// run-rustfix
|
||||
|
||||
#![allow(clippy::option_and_then_some)]
|
||||
|
||||
fn main() {
|
||||
let opt = Some(1);
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
// run-rustfix
|
||||
|
||||
#![allow(clippy::option_and_then_some)]
|
||||
|
||||
fn main() {
|
||||
let opt = Some(1);
|
||||
|
||||
|
@ -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| {
|
||||
| _____________^
|
||||
|
Loading…
Reference in New Issue
Block a user