]> git.lizzy.rs Git - rust.git/blob - tests/ui/manual_find_map.stderr
Merge remote-tracking branch 'upstream/master' into rustup
[rust.git] / tests / ui / manual_find_map.stderr
1 error: `find(..).map(..)` can be simplified as `find_map(..)`
2   --> $DIR/manual_find_map.rs:8:19
3    |
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))`
6    |
7    = note: `-D clippy::manual-find-map` implied by `-D warnings`
8
9 error: `find(..).map(..)` can be simplified as `find_map(..)`
10   --> $DIR/manual_find_map.rs:11:19
11    |
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))`
14
15 error: `find(..).map(..)` can be simplified as `find_map(..)`
16   --> $DIR/manual_find_map.rs:14:19
17    |
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())`
20
21 error: `find(..).map(..)` can be simplified as `find_map(..)`
22   --> $DIR/manual_find_map.rs:54:10
23    |
24 LL |           .find(|f| f.option_field.is_some())
25    |  __________^
26 LL | |         .map(|f| f.option_field.clone().unwrap());
27    | |_________________________________________________^ help: try: `find_map(|f| f.option_field.clone())`
28
29 error: `find(..).map(..)` can be simplified as `find_map(..)`
30   --> $DIR/manual_find_map.rs:59:10
31    |
32 LL |           .find(|f| f.ref_field.is_some())
33    |  __________^
34 LL | |         .map(|f| f.ref_field.cloned().unwrap());
35    | |_______________________________________________^ help: try: `find_map(|f| f.ref_field.cloned())`
36
37 error: `find(..).map(..)` can be simplified as `find_map(..)`
38   --> $DIR/manual_find_map.rs:64:10
39    |
40 LL |           .find(|f| f.ref_field.is_some())
41    |  __________^
42 LL | |         .map(|f| f.ref_field.copied().unwrap());
43    | |_______________________________________________^ help: try: `find_map(|f| f.ref_field.copied())`
44
45 error: `find(..).map(..)` can be simplified as `find_map(..)`
46   --> $DIR/manual_find_map.rs:69:10
47    |
48 LL |           .find(|f| f.result_field.is_ok())
49    |  __________^
50 LL | |         .map(|f| f.result_field.clone().unwrap());
51    | |_________________________________________________^ help: try: `find_map(|f| f.result_field.clone().ok())`
52
53 error: `find(..).map(..)` can be simplified as `find_map(..)`
54   --> $DIR/manual_find_map.rs:74:10
55    |
56 LL |           .find(|f| f.result_field.is_ok())
57    |  __________^
58 LL | |         .map(|f| f.result_field.as_ref().unwrap());
59    | |__________________________________________________^ help: try: `find_map(|f| f.result_field.as_ref().ok())`
60
61 error: `find(..).map(..)` can be simplified as `find_map(..)`
62   --> $DIR/manual_find_map.rs:79:10
63    |
64 LL |           .find(|f| f.result_field.is_ok())
65    |  __________^
66 LL | |         .map(|f| f.result_field.as_deref().unwrap());
67    | |____________________________________________________^ help: try: `find_map(|f| f.result_field.as_deref().ok())`
68
69 error: `find(..).map(..)` can be simplified as `find_map(..)`
70   --> $DIR/manual_find_map.rs:84:10
71    |
72 LL |           .find(|f| f.result_field.is_ok())
73    |  __________^
74 LL | |         .map(|f| f.result_field.as_mut().unwrap());
75    | |__________________________________________________^ help: try: `find_map(|f| f.result_field.as_mut().ok())`
76
77 error: `find(..).map(..)` can be simplified as `find_map(..)`
78   --> $DIR/manual_find_map.rs:89:10
79    |
80 LL |           .find(|f| f.result_field.is_ok())
81    |  __________^
82 LL | |         .map(|f| f.result_field.as_deref_mut().unwrap());
83    | |________________________________________________________^ help: try: `find_map(|f| f.result_field.as_deref_mut().ok())`
84
85 error: `find(..).map(..)` can be simplified as `find_map(..)`
86   --> $DIR/manual_find_map.rs:94:10
87    |
88 LL |           .find(|f| f.result_field.is_ok())
89    |  __________^
90 LL | |         .map(|f| f.result_field.to_owned().unwrap());
91    | |____________________________________________________^ help: try: `find_map(|f| f.result_field.to_owned().ok())`
92
93 error: aborting due to 12 previous errors
94