Sign in
rust
/
rust-clippy
/
ef6e711dc1c8feaa1f00a41bc5b0ca9fcbce1fb3
/
.
/
tests
/
ui
/
flat_map_option.rs
blob: 128d9d7bd87667e99a6661bc40b0314c5c14afd4 [
file
]
#![
warn
(
clippy
::
flat_map_option
)]
fn
main
()
{
// yay
let
c
=
|
x
|
Some
(
x
);
let
_
=
[
1
].
iter
().
flat_map
(
c
);
//~^ flat_map_option
let
_
=
[
1
].
iter
().
flat_map
(
Some
);
//~^ flat_map_option
// nay
let
_
=
[
1
].
iter
().
flat_map
(|
_
|
&
Some
(
1
));
}