]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/flat_map_option.rs
Auto merge of #99099 - Stargateur:phantomdata_debug, r=joshtriplett
[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 }