]> git.lizzy.rs Git - rust.git/blob - tests/ui/flat_map_option.fixed
Rollup merge of #92849 - flip1995:clippyup, r=Manishearth
[rust.git] / tests / ui / flat_map_option.fixed
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().filter_map(c);
9     let _ = [1].iter().filter_map(Some);
10
11     // nay
12     let _ = [1].iter().flat_map(|_| &Some(1));
13 }