]> git.proxmox.com Git - rustc.git/blob - src/tools/clippy/tests/ui/flat_map_option.fixed
New upstream version 1.53.0+dfsg1
[rustc.git] / src / tools / clippy / 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 }