blob: c3992d7e92cf37c36d0c5568aa3a462bfcd2278b (
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().find_map(|s| s.parse().ok());
assert_eq!(element, Some(1));
}
|