diff options
| author | David Lönnhager <david.l@mullvad.net> | 2021-04-27 18:46:18 +0200 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2021-05-17 11:08:50 +0200 |
| commit | d478193d76099077cdc4afd3bda5e48ecc6f1a1b (patch) | |
| tree | 9d7f2ef82b37432d0e5833d85c4c3c2e1d7d7ccb /mullvad-management-interface/src | |
| parent | 176690bc2e4a4d6c1267552b7f84804392528f19 (diff) | |
| download | mullvadvpn-d478193d76099077cdc4afd3bda5e48ecc6f1a1b.tar.xz mullvadvpn-d478193d76099077cdc4afd3bda5e48ecc6f1a1b.zip | |
Include entry endpoint in 'mullvad relay get'
Diffstat (limited to 'mullvad-management-interface/src')
| -rw-r--r-- | mullvad-management-interface/src/types.rs | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/mullvad-management-interface/src/types.rs b/mullvad-management-interface/src/types.rs index 9530c89a70..7d219e0b4a 100644 --- a/mullvad-management-interface/src/types.rs +++ b/mullvad-management-interface/src/types.rs @@ -315,6 +315,25 @@ impl From<IpVersion> for IpVersionConstraint { } } +impl + From< + mullvad_types::relay_constraints::Constraint< + mullvad_types::relay_constraints::LocationConstraint, + >, + > for RelayLocation +{ + fn from( + location: mullvad_types::relay_constraints::Constraint< + mullvad_types::relay_constraints::LocationConstraint, + >, + ) -> Self { + location + .option() + .map(RelayLocation::from) + .unwrap_or_default() + } +} + impl From<mullvad_types::relay_constraints::LocationConstraint> for RelayLocation { fn from(location: mullvad_types::relay_constraints::LocationConstraint) -> Self { use mullvad_types::relay_constraints::LocationConstraint; @@ -457,7 +476,7 @@ impl From<mullvad_types::relay_constraints::RelaySettings> for RelaySettings { entry_location: constraints .wireguard_constraints .entry_location - .and_then(|constraint| constraint.option().map(RelayLocation::from)), + .map(RelayLocation::from), }), openvpn_constraints: Some(OpenvpnConstraints { |
