@@ -19,58 +19,76 @@ LL | let _ = (0..).filter(|&n| to_res(n).is_ok()).map(|a| to_res(a).unwrap_o
1919 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `filter_map(|a| to_res(a).ok())`
2020
2121error: `filter(..).map(..)` can be simplified as `filter_map(..)`
22- --> $DIR/manual_filter_map.rs:53 :10
22+ --> $DIR/manual_filter_map.rs:54 :10
2323 |
24- LL | .filter(|f| f.field .is_some())
24+ LL | .filter(|f| f.option_field .is_some())
2525 | __________^
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())`
2828
2929error: `filter(..).map(..)` can be simplified as `filter_map(..)`
30- --> $DIR/manual_filter_map.rs:59:24
30+ --> $DIR/manual_filter_map.rs:59:10
3131 |
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())`
3452
3553error: `filter(..).map(..)` can be simplified as `filter_map(..)`
36- --> $DIR/manual_filter_map.rs:63 :10
54+ --> $DIR/manual_filter_map.rs:74 :10
3755 |
38- LL | .filter(|f| f.field .is_ok())
56+ LL | .filter(|f| f.result_field .is_ok())
3957 | __________^
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())`
4260
4361error: `filter(..).map(..)` can be simplified as `filter_map(..)`
44- --> $DIR/manual_filter_map.rs:68 :10
62+ --> $DIR/manual_filter_map.rs:79 :10
4563 |
46- LL | .filter(|f| f.field .is_ok())
64+ LL | .filter(|f| f.result_field .is_ok())
4765 | __________^
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())`
5068
5169error: `filter(..).map(..)` can be simplified as `filter_map(..)`
52- --> $DIR/manual_filter_map.rs:73 :10
70+ --> $DIR/manual_filter_map.rs:84 :10
5371 |
54- LL | .filter(|f| f.field .is_ok())
72+ LL | .filter(|f| f.result_field .is_ok())
5573 | __________^
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())`
5876
5977error: `filter(..).map(..)` can be simplified as `filter_map(..)`
60- --> $DIR/manual_filter_map.rs:78 :10
78+ --> $DIR/manual_filter_map.rs:89 :10
6179 |
62- LL | .filter(|f| f.field .is_ok())
80+ LL | .filter(|f| f.result_field .is_ok())
6381 | __________^
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())`
6684
6785error: `filter(..).map(..)` can be simplified as `filter_map(..)`
68- --> $DIR/manual_filter_map.rs:83 :10
86+ --> $DIR/manual_filter_map.rs:94 :10
6987 |
70- LL | .filter(|f| f.field .is_ok())
88+ LL | .filter(|f| f.result_field .is_ok())
7189 | __________^
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())`
7492
75- error: aborting due to 10 previous errors
93+ error: aborting due to 12 previous errors
7694
0 commit comments