rust/tests/ui/find_map.stderr

27 lines
938 B
Plaintext
Raw Normal View History

error: called `find(..).map(..)` on an `Iterator`
2019-04-27 17:06:35 -05:00
--> $DIR/find_map.rs:20:26
|
LL | let _: Option<i32> = a.iter().find(|s| s.parse::<i32>().is_ok()).map(|s| s.parse().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::find-map` implied by `-D warnings`
2020-01-25 16:01:16 -06:00
= help: this is more succinctly expressed by calling `.find_map(..)` instead
2019-04-27 17:06:35 -05:00
error: called `find(..).map(..)` on an `Iterator`
--> $DIR/find_map.rs:23:29
2019-04-27 17:06:35 -05:00
|
LL | let _: Option<Flavor> = desserts_of_the_week
| _____________________________^
LL | | .iter()
LL | | .find(|dessert| match *dessert {
LL | | Dessert::Cake(_) => true,
... |
LL | | _ => unreachable!(),
LL | | });
| |__________^
2020-01-24 02:04:46 -06:00
|
2020-01-25 16:01:16 -06:00
= help: this is more succinctly expressed by calling `.find_map(..)` instead
2019-04-27 17:06:35 -05:00
error: aborting due to 2 previous errors