]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/filter_map_next.rs
New upstream version 1.52.1+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / filter_map_next.rs
CommitLineData
f20569fa
XL
1#![warn(clippy::all, clippy::pedantic)]
2
3fn 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}