diff options
Diffstat (limited to 'src/tools/clippy/tests/ui/filter_map_next_fixable.fixed')
-rw-r--r-- | src/tools/clippy/tests/ui/filter_map_next_fixable.fixed | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/filter_map_next_fixable.fixed b/src/tools/clippy/tests/ui/filter_map_next_fixable.fixed new file mode 100644 index 000000000..c3992d7e9 --- /dev/null +++ b/src/tools/clippy/tests/ui/filter_map_next_fixable.fixed @@ -0,0 +1,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)); +} |