]> git.lizzy.rs Git - rust.git/blob - tests/ui/filter_map_next_fixable.stderr
Fix `unnecessary_cast` suggestion when taking a reference
[rust.git] / tests / ui / filter_map_next_fixable.stderr
1 error: called `filter_map(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find_map(..)` instead
2   --> $DIR/filter_map_next_fixable.rs:9:32
3    |
4 LL |     let element: Option<i32> = a.iter().filter_map(|s| s.parse().ok()).next();
5    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `a.iter().find_map(|s| s.parse().ok())`
6    |
7    = note: `-D clippy::filter-map-next` implied by `-D warnings`
8
9 error: called `filter_map(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find_map(..)` instead
10   --> $DIR/filter_map_next_fixable.rs:22:26
11    |
12 LL |     let _: Option<i32> = a.iter().filter_map(|s| s.parse().ok()).next();
13    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `a.iter().find_map(|s| s.parse().ok())`
14
15 error: aborting due to 2 previous errors
16