File tree Expand file tree Collapse file tree 1 file changed +15
-16
lines changed
order-routing/rust/rankers/default/src Expand file tree Collapse file tree 1 file changed +15
-16
lines changed Original file line number Diff line number Diff line change @@ -17,26 +17,25 @@ fn function(input: input::ResponseData) -> Result<output::FunctionResult> {
17
17
. fulfillment_groups
18
18
. iter ( )
19
19
. map ( |group| {
20
- let fulfillment_group_id = group. id . clone ( ) ;
21
20
let rankings = group
22
21
. inventory_locations
23
- . clone ( )
24
- . unwrap ( )
25
- . iter ( )
26
- . map ( |inventory_location| {
27
- let location_id = inventory_location . location . id . clone ( ) ;
28
- output :: RankedLocation {
29
- location_id ,
30
- rank : 0 ,
31
- }
22
+ . as_ref ( )
23
+ . map ( |locations| {
24
+ locations
25
+ . iter ( )
26
+ . map ( |location| output :: RankedLocation {
27
+ location_id : location . location . id . clone ( ) ,
28
+ rank : 0 ,
29
+ } )
30
+ . collect ( )
32
31
} )
33
- . collect ( ) ;
34
- let rank_operation = output:: FulfillmentGroupRankedLocations {
35
- fulfillment_group_id,
36
- rankings,
37
- } ;
32
+ . unwrap_or_else ( Vec :: new) ;
33
+
38
34
output:: Operation {
39
- rank : rank_operation,
35
+ rank : output:: FulfillmentGroupRankedLocations {
36
+ fulfillment_group_id : group. id . clone ( ) ,
37
+ rankings,
38
+ } ,
40
39
}
41
40
} )
42
41
. collect ( ) ;
You can’t perform that action at this time.
0 commit comments