]> git.lizzy.rs Git - rust.git/blob - tests/ui/find_map.stderr
Auto merge of #4314 - chansuke:add-negation-to-is_empty, r=flip1995
[rust.git] / tests / ui / find_map.stderr
1 error: called `find(p).map(q)` on an `Iterator`. This is more succinctly expressed by calling `.find_map(..)` instead.
2   --> $DIR/find_map.rs:20:26
3    |
4 LL |     let _: Option<i32> = a.iter().find(|s| s.parse::<i32>().is_ok()).map(|s| s.parse().unwrap());
5    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6    |
7    = note: `-D clippy::find-map` implied by `-D warnings`
8
9 error: called `find(p).map(q)` on an `Iterator`. This is more succinctly expressed by calling `.find_map(..)` instead.
10   --> $DIR/find_map.rs:22:29
11    |
12 LL |       let _: Option<Flavor> = desserts_of_the_week
13    |  _____________________________^
14 LL | |         .iter()
15 LL | |         .find(|dessert| match *dessert {
16 LL | |             Dessert::Cake(_) => true,
17 ...  |
18 LL | |             _ => unreachable!(),
19 LL | |         });
20    | |__________^
21
22 error: aborting due to 2 previous errors
23