]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/flat_map_option.rs
Rollup merge of #100076 - tspiteri:const_slice_split_at, r=oli-obk
[rust.git] / src / tools / clippy / tests / ui / flat_map_option.rs
1 // run-rustfix
2 #![warn(clippy::flat_map_option)]
3 #![allow(clippy::redundant_closure, clippy::unnecessary_filter_map)]
4
5 fn main() {
6     // yay
7     let c = |x| Some(x);
8     let _ = [1].iter().flat_map(c);
9     let _ = [1].iter().flat_map(Some);
10
11     // nay
12     let _ = [1].iter().flat_map(|_| &Some(1));
13 }