summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/filter_map_next_fixable.rs
blob: 447219a96839181630629af538bd834624f0bb51 (plain)
1
2
3
4
5
6
7
8
9
10
// run-rustfix

#![warn(clippy::all, clippy::pedantic)]

fn main() {
    let a = ["1", "lol", "3", "NaN", "5"];

    let element: Option<i32> = a.iter().filter_map(|s| s.parse().ok()).next();
    assert_eq!(element, Some(1));
}