]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/filter_map_next.rs
Auto merge of #99099 - Stargateur:phantomdata_debug, r=joshtriplett
[rust.git] / src / tools / clippy / tests / ui / filter_map_next.rs
1 #![warn(clippy::all, clippy::pedantic)]
2
3 fn main() {
4     let a = ["1", "lol", "3", "NaN", "5"];
5
6     #[rustfmt::skip]
7     let _: Option<u32> = vec![1, 2, 3, 4, 5, 6]
8         .into_iter()
9         .filter_map(|x| {
10             if x == 2 {
11                 Some(x * 2)
12             } else {
13                 None
14             }
15         })
16         .next();
17 }