Skip to content

Commit e10a5db

Browse files
pr review suggestion
1 parent c74b639 commit e10a5db

1 file changed

Lines changed: 16 additions & 8 deletions

File tree

cli/src/cmd_net.rs

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use oxide::{
1919
LinkSpeed, LldpLinkConfigCreate, Name, NameOrId, Route, RouteConfig,
2020
SwitchInterfaceConfigCreate, SwitchInterfaceKind, SwitchInterfaceKind2, SwitchLocation,
2121
SwitchPort, SwitchPortConfigCreate, SwitchPortGeometry, SwitchPortGeometry2,
22-
SwitchPortSettingsCreate,
22+
SwitchPortRouteConfig, SwitchPortSettingsCreate,
2323
},
2424
Client, ClientSystemHardwareExt, ClientSystemNetworkingExt,
2525
};
@@ -1780,13 +1780,21 @@ async fn create_current(settings_id: Uuid, client: &Client) -> Result<SwitchPort
17801780
link_name: PHY0.parse().unwrap(),
17811781
routes: current
17821782
.routes
1783-
.iter()
1784-
.map(|x| Route {
1785-
dst: x.dst.clone(),
1786-
gw: x.gw,
1787-
vid: x.vlan_id,
1788-
rib_priority: x.rib_priority,
1789-
})
1783+
.into_iter()
1784+
.map(
1785+
|SwitchPortRouteConfig {
1786+
dst,
1787+
gw,
1788+
rib_priority,
1789+
vlan_id,
1790+
..
1791+
}| Route {
1792+
dst,
1793+
gw,
1794+
vid: vlan_id,
1795+
rib_priority,
1796+
},
1797+
)
17901798
.collect(),
17911799
};
17921800

0 commit comments

Comments
 (0)