@@ -18,5 +18,77 @@ error: `filter(..).map(..)` can be simplified as `filter_map(..)`
18
18
LL | let _ = (0..).filter(|&n| to_res(n).is_ok()).map(|a| to_res(a).unwrap_or(1));
19
19
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `filter_map(|a| to_res(a).ok())`
20
20
21
- error: aborting due to 3 previous errors
21
+ error: `filter(..).map(..)` can be simplified as `filter_map(..)`
22
+ --> $DIR/manual_filter_map.rs:54:10
23
+ |
24
+ LL | .filter(|f| f.option_field.is_some())
25
+ | __________^
26
+ LL | | .map(|f| f.option_field.clone().unwrap());
27
+ | |_________________________________________________^ help: try: `filter_map(|f| f.option_field.clone())`
28
+
29
+ error: `filter(..).map(..)` can be simplified as `filter_map(..)`
30
+ --> $DIR/manual_filter_map.rs:59:10
31
+ |
32
+ LL | .filter(|f| f.ref_field.is_some())
33
+ | __________^
34
+ LL | | .map(|f| f.ref_field.cloned().unwrap());
35
+ | |_______________________________________________^ help: try: `filter_map(|f| f.ref_field.cloned())`
36
+
37
+ error: `filter(..).map(..)` can be simplified as `filter_map(..)`
38
+ --> $DIR/manual_filter_map.rs:64:10
39
+ |
40
+ LL | .filter(|f| f.ref_field.is_some())
41
+ | __________^
42
+ LL | | .map(|f| f.ref_field.copied().unwrap());
43
+ | |_______________________________________________^ help: try: `filter_map(|f| f.ref_field.copied())`
44
+
45
+ error: `filter(..).map(..)` can be simplified as `filter_map(..)`
46
+ --> $DIR/manual_filter_map.rs:69:10
47
+ |
48
+ LL | .filter(|f| f.result_field.is_ok())
49
+ | __________^
50
+ LL | | .map(|f| f.result_field.clone().unwrap());
51
+ | |_________________________________________________^ help: try: `filter_map(|f| f.result_field.clone().ok())`
52
+
53
+ error: `filter(..).map(..)` can be simplified as `filter_map(..)`
54
+ --> $DIR/manual_filter_map.rs:74:10
55
+ |
56
+ LL | .filter(|f| f.result_field.is_ok())
57
+ | __________^
58
+ LL | | .map(|f| f.result_field.as_ref().unwrap());
59
+ | |__________________________________________________^ help: try: `filter_map(|f| f.result_field.as_ref().ok())`
60
+
61
+ error: `filter(..).map(..)` can be simplified as `filter_map(..)`
62
+ --> $DIR/manual_filter_map.rs:79:10
63
+ |
64
+ LL | .filter(|f| f.result_field.is_ok())
65
+ | __________^
66
+ LL | | .map(|f| f.result_field.as_deref().unwrap());
67
+ | |____________________________________________________^ help: try: `filter_map(|f| f.result_field.as_deref().ok())`
68
+
69
+ error: `filter(..).map(..)` can be simplified as `filter_map(..)`
70
+ --> $DIR/manual_filter_map.rs:84:10
71
+ |
72
+ LL | .filter(|f| f.result_field.is_ok())
73
+ | __________^
74
+ LL | | .map(|f| f.result_field.as_mut().unwrap());
75
+ | |__________________________________________________^ help: try: `filter_map(|f| f.result_field.as_mut().ok())`
76
+
77
+ error: `filter(..).map(..)` can be simplified as `filter_map(..)`
78
+ --> $DIR/manual_filter_map.rs:89:10
79
+ |
80
+ LL | .filter(|f| f.result_field.is_ok())
81
+ | __________^
82
+ LL | | .map(|f| f.result_field.as_deref_mut().unwrap());
83
+ | |________________________________________________________^ help: try: `filter_map(|f| f.result_field.as_deref_mut().ok())`
84
+
85
+ error: `filter(..).map(..)` can be simplified as `filter_map(..)`
86
+ --> $DIR/manual_filter_map.rs:94:10
87
+ |
88
+ LL | .filter(|f| f.result_field.is_ok())
89
+ | __________^
90
+ LL | | .map(|f| f.result_field.to_owned().unwrap());
91
+ | |____________________________________________________^ help: try: `filter_map(|f| f.result_field.to_owned().ok())`
92
+
93
+ error: aborting due to 12 previous errors
22
94
0 commit comments