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