1 error: `find(..).map(..)` can be simplified as `find_map(..)`
2 --> $DIR/manual_find_map.rs:8:19
4 LL | let _ = (0..).find(|n| to_opt(*n).is_some()).map(|a| to_opt(a).unwrap());
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `find_map(|a| to_opt(a))`
7 = note: `-D clippy::manual-find-map` implied by `-D warnings`
9 error: `find(..).map(..)` can be simplified as `find_map(..)`
10 --> $DIR/manual_find_map.rs:11:19
12 LL | let _ = (0..).find(|&n| to_opt(n).is_some()).map(|a| to_opt(a).expect("hi"));
13 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `find_map(|a| to_opt(a))`
15 error: `find(..).map(..)` can be simplified as `find_map(..)`
16 --> $DIR/manual_find_map.rs:14:19
18 LL | let _ = (0..).find(|&n| to_res(n).is_ok()).map(|a| to_res(a).unwrap_or(1));
19 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `find_map(|a| to_res(a).ok())`
21 error: `find(..).map(..)` can be simplified as `find_map(..)`
22 --> $DIR/manual_find_map.rs:54:10
24 LL | .find(|f| f.option_field.is_some())
26 LL | | .map(|f| f.option_field.clone().unwrap());
27 | |_________________________________________________^ help: try: `find_map(|f| f.option_field.clone())`
29 error: `find(..).map(..)` can be simplified as `find_map(..)`
30 --> $DIR/manual_find_map.rs:59:10
32 LL | .find(|f| f.ref_field.is_some())
34 LL | | .map(|f| f.ref_field.cloned().unwrap());
35 | |_______________________________________________^ help: try: `find_map(|f| f.ref_field.cloned())`
37 error: `find(..).map(..)` can be simplified as `find_map(..)`
38 --> $DIR/manual_find_map.rs:64:10
40 LL | .find(|f| f.ref_field.is_some())
42 LL | | .map(|f| f.ref_field.copied().unwrap());
43 | |_______________________________________________^ help: try: `find_map(|f| f.ref_field.copied())`
45 error: `find(..).map(..)` can be simplified as `find_map(..)`
46 --> $DIR/manual_find_map.rs:69:10
48 LL | .find(|f| f.result_field.is_ok())
50 LL | | .map(|f| f.result_field.clone().unwrap());
51 | |_________________________________________________^ help: try: `find_map(|f| f.result_field.clone().ok())`
53 error: `find(..).map(..)` can be simplified as `find_map(..)`
54 --> $DIR/manual_find_map.rs:74:10
56 LL | .find(|f| f.result_field.is_ok())
58 LL | | .map(|f| f.result_field.as_ref().unwrap());
59 | |__________________________________________________^ help: try: `find_map(|f| f.result_field.as_ref().ok())`
61 error: `find(..).map(..)` can be simplified as `find_map(..)`
62 --> $DIR/manual_find_map.rs:79:10
64 LL | .find(|f| f.result_field.is_ok())
66 LL | | .map(|f| f.result_field.as_deref().unwrap());
67 | |____________________________________________________^ help: try: `find_map(|f| f.result_field.as_deref().ok())`
69 error: `find(..).map(..)` can be simplified as `find_map(..)`
70 --> $DIR/manual_find_map.rs:84:10
72 LL | .find(|f| f.result_field.is_ok())
74 LL | | .map(|f| f.result_field.as_mut().unwrap());
75 | |__________________________________________________^ help: try: `find_map(|f| f.result_field.as_mut().ok())`
77 error: `find(..).map(..)` can be simplified as `find_map(..)`
78 --> $DIR/manual_find_map.rs:89:10
80 LL | .find(|f| f.result_field.is_ok())
82 LL | | .map(|f| f.result_field.as_deref_mut().unwrap());
83 | |________________________________________________________^ help: try: `find_map(|f| f.result_field.as_deref_mut().ok())`
85 error: `find(..).map(..)` can be simplified as `find_map(..)`
86 --> $DIR/manual_find_map.rs:94:10
88 LL | .find(|f| f.result_field.is_ok())
90 LL | | .map(|f| f.result_field.to_owned().unwrap());
91 | |____________________________________________________^ help: try: `find_map(|f| f.result_field.to_owned().ok())`
93 error: aborting due to 12 previous errors