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:17:10
24 LL | .find(|&x| to_ref(to_opt(x)).is_some())
26 LL | | .map(|y| to_ref(to_opt(y)).unwrap());
27 | |____________________________________________^ help: try: `find_map(|y| *to_ref(to_opt(y)))`
29 error: `find(..).map(..)` can be simplified as `find_map(..)`
30 --> $DIR/manual_find_map.rs:20:10
32 LL | .find(|x| to_ref(to_opt(*x)).is_some())
34 LL | | .map(|y| to_ref(to_opt(y)).unwrap());
35 | |____________________________________________^ help: try: `find_map(|y| *to_ref(to_opt(y)))`
37 error: `find(..).map(..)` can be simplified as `find_map(..)`
38 --> $DIR/manual_find_map.rs:24:10
40 LL | .find(|&x| to_ref(to_res(x)).is_ok())
42 LL | | .map(|y| to_ref(to_res(y)).unwrap());
43 | |____________________________________________^ help: try: `find_map(|y| to_ref(to_res(y)).ok())`
45 error: `find(..).map(..)` can be simplified as `find_map(..)`
46 --> $DIR/manual_find_map.rs:27:10
48 LL | .find(|x| to_ref(to_res(*x)).is_ok())
50 LL | | .map(|y| to_ref(to_res(y)).unwrap());
51 | |____________________________________________^ help: try: `find_map(|y| to_ref(to_res(y)).ok())`
53 error: `find(..).map(..)` can be simplified as `find_map(..)`
54 --> $DIR/manual_find_map.rs:33:26
56 LL | iter::<Option<u8>>().find(|x| x.is_some()).map(|x| x.unwrap());
57 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `find_map(|x| x)`
59 error: `find(..).map(..)` can be simplified as `find_map(..)`
60 --> $DIR/manual_find_map.rs:34:27
62 LL | iter::<&Option<u8>>().find(|x| x.is_some()).map(|x| x.unwrap());
63 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `find_map(|x| *x)`
65 error: `find(..).map(..)` can be simplified as `find_map(..)`
66 --> $DIR/manual_find_map.rs:35:28
68 LL | iter::<&&Option<u8>>().find(|x| x.is_some()).map(|x| x.unwrap());
69 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `find_map(|x| **x)`
71 error: `find(..).map(..)` can be simplified as `find_map(..)`
72 --> $DIR/manual_find_map.rs:36:27
74 LL | iter::<Option<&u8>>().find(|x| x.is_some()).map(|x| x.cloned().unwrap());
75 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `find_map(|x| x.cloned())`
77 error: `find(..).map(..)` can be simplified as `find_map(..)`
78 --> $DIR/manual_find_map.rs:37:28
80 LL | iter::<&Option<&u8>>().find(|x| x.is_some()).map(|x| x.cloned().unwrap());
81 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `find_map(|x| x.cloned())`
83 error: `find(..).map(..)` can be simplified as `find_map(..)`
84 --> $DIR/manual_find_map.rs:38:31
86 LL | iter::<&Option<String>>().find(|x| x.is_some()).map(|x| x.as_deref().unwrap());
87 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `find_map(|x| x.as_deref())`
89 error: `find(..).map(..)` can be simplified as `find_map(..)`
90 --> $DIR/manual_find_map.rs:39:31
92 LL | iter::<Option<&String>>().find(|&x| to_ref(x).is_some()).map(|y| to_ref(y).cloned().unwrap());
93 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `find_map(|y| to_ref(y).cloned())`
95 error: `find(..).map(..)` can be simplified as `find_map(..)`
96 --> $DIR/manual_find_map.rs:41:30
98 LL | iter::<Result<u8, ()>>().find(|x| x.is_ok()).map(|x| x.unwrap());
99 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `find_map(|x| x.ok())`
101 error: `find(..).map(..)` can be simplified as `find_map(..)`
102 --> $DIR/manual_find_map.rs:42:31
104 LL | iter::<&Result<u8, ()>>().find(|x| x.is_ok()).map(|x| x.unwrap());
105 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `find_map(|x| x.ok())`
107 error: `find(..).map(..)` can be simplified as `find_map(..)`
108 --> $DIR/manual_find_map.rs:43:32
110 LL | iter::<&&Result<u8, ()>>().find(|x| x.is_ok()).map(|x| x.unwrap());
111 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `find_map(|x| x.ok())`
113 error: `find(..).map(..)` can be simplified as `find_map(..)`
114 --> $DIR/manual_find_map.rs:44:31
116 LL | iter::<Result<&u8, ()>>().find(|x| x.is_ok()).map(|x| x.cloned().unwrap());
117 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `find_map(|x| x.cloned().ok())`
119 error: `find(..).map(..)` can be simplified as `find_map(..)`
120 --> $DIR/manual_find_map.rs:45:32
122 LL | iter::<&Result<&u8, ()>>().find(|x| x.is_ok()).map(|x| x.cloned().unwrap());
123 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `find_map(|x| x.cloned().ok())`
125 error: `find(..).map(..)` can be simplified as `find_map(..)`
126 --> $DIR/manual_find_map.rs:46:35
128 LL | iter::<&Result<String, ()>>().find(|x| x.is_ok()).map(|x| x.as_deref().unwrap());
129 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `find_map(|x| x.as_deref().ok())`
131 error: `find(..).map(..)` can be simplified as `find_map(..)`
132 --> $DIR/manual_find_map.rs:47:35
134 LL | iter::<Result<&String, ()>>().find(|&x| to_ref(x).is_ok()).map(|y| to_ref(y).cloned().unwrap());
135 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `find_map(|y| to_ref(y).cloned().ok())`
137 error: `find(..).map(..)` can be simplified as `find_map(..)`
138 --> $DIR/manual_find_map.rs:95:10
140 LL | .find(|f| f.option_field.is_some())
142 LL | | .map(|f| f.option_field.clone().unwrap());
143 | |_________________________________________________^ help: try: `find_map(|f| f.option_field.clone())`
145 error: `find(..).map(..)` can be simplified as `find_map(..)`
146 --> $DIR/manual_find_map.rs:100:10
148 LL | .find(|f| f.ref_field.is_some())
150 LL | | .map(|f| f.ref_field.cloned().unwrap());
151 | |_______________________________________________^ help: try: `find_map(|f| f.ref_field.cloned())`
153 error: `find(..).map(..)` can be simplified as `find_map(..)`
154 --> $DIR/manual_find_map.rs:105:10
156 LL | .find(|f| f.ref_field.is_some())
158 LL | | .map(|f| f.ref_field.copied().unwrap());
159 | |_______________________________________________^ help: try: `find_map(|f| f.ref_field.copied())`
161 error: `find(..).map(..)` can be simplified as `find_map(..)`
162 --> $DIR/manual_find_map.rs:110:10
164 LL | .find(|f| f.result_field.is_ok())
166 LL | | .map(|f| f.result_field.clone().unwrap());
167 | |_________________________________________________^ help: try: `find_map(|f| f.result_field.clone().ok())`
169 error: `find(..).map(..)` can be simplified as `find_map(..)`
170 --> $DIR/manual_find_map.rs:115:10
172 LL | .find(|f| f.result_field.is_ok())
174 LL | | .map(|f| f.result_field.as_ref().unwrap());
175 | |__________________________________________________^ help: try: `find_map(|f| f.result_field.as_ref().ok())`
177 error: `find(..).map(..)` can be simplified as `find_map(..)`
178 --> $DIR/manual_find_map.rs:120:10
180 LL | .find(|f| f.result_field.is_ok())
182 LL | | .map(|f| f.result_field.as_deref().unwrap());
183 | |____________________________________________________^ help: try: `find_map(|f| f.result_field.as_deref().ok())`
185 error: `find(..).map(..)` can be simplified as `find_map(..)`
186 --> $DIR/manual_find_map.rs:125:10
188 LL | .find(|f| f.result_field.is_ok())
190 LL | | .map(|f| f.result_field.as_mut().unwrap());
191 | |__________________________________________________^ help: try: `find_map(|f| f.result_field.as_mut().ok())`
193 error: `find(..).map(..)` can be simplified as `find_map(..)`
194 --> $DIR/manual_find_map.rs:130:10
196 LL | .find(|f| f.result_field.is_ok())
198 LL | | .map(|f| f.result_field.as_deref_mut().unwrap());
199 | |________________________________________________________^ help: try: `find_map(|f| f.result_field.as_deref_mut().ok())`
201 error: `find(..).map(..)` can be simplified as `find_map(..)`
202 --> $DIR/manual_find_map.rs:135:10
204 LL | .find(|f| f.result_field.is_ok())
206 LL | | .map(|f| f.result_field.to_owned().unwrap());
207 | |____________________________________________________^ help: try: `find_map(|f| f.result_field.to_owned().ok())`
209 error: aborting due to 30 previous errors