wireguard-control: cargo fmt
parent
c80fe23e1c
commit
4a682f8adc
|
@ -141,10 +141,11 @@ impl<'a> TryFrom<&'a [WgDeviceAttrs]> for Device {
|
||||||
let private_key = get_nla_value!(nlas, WgDeviceAttrs, PrivateKey).map(|key| Key(*key));
|
let private_key = get_nla_value!(nlas, WgDeviceAttrs, PrivateKey).map(|key| Key(*key));
|
||||||
let listen_port = get_nla_value!(nlas, WgDeviceAttrs, ListenPort).cloned();
|
let listen_port = get_nla_value!(nlas, WgDeviceAttrs, ListenPort).cloned();
|
||||||
let fwmark = get_nla_value!(nlas, WgDeviceAttrs, Fwmark).cloned();
|
let fwmark = get_nla_value!(nlas, WgDeviceAttrs, Fwmark).cloned();
|
||||||
let peers = nlas.iter()
|
let peers = nlas
|
||||||
|
.iter()
|
||||||
.filter_map(|nla| match nla {
|
.filter_map(|nla| match nla {
|
||||||
WgDeviceAttrs::Peers(peers) => Some(peers.clone()),
|
WgDeviceAttrs::Peers(peers) => Some(peers.clone()),
|
||||||
_ => None
|
_ => None,
|
||||||
})
|
})
|
||||||
.flatten()
|
.flatten()
|
||||||
.map(PeerInfo::try_from)
|
.map(PeerInfo::try_from)
|
||||||
|
|
Loading…
Reference in New Issue