diff options
| author | Markus Pettersson <markus.pettersson@mullvad.net> | 2024-11-06 08:57:40 +0100 |
|---|---|---|
| committer | Markus Pettersson <markus.pettersson@mullvad.net> | 2024-11-12 09:08:12 +0100 |
| commit | b7c518238c805e1d3c5954da5d3d3ceb7adee4e1 (patch) | |
| tree | 230777fbd35edac630c08b035bf0d56c84893609 | |
| parent | 6de124460897f636f6e4c358161a8424b09ca546 (diff) | |
| download | mullvadvpn-b7c518238c805e1d3c5954da5d3d3ceb7adee4e1.tar.xz mullvadvpn-b7c518238c805e1d3c5954da5d3d3ceb7adee4e1.zip | |
Generalize `entry` and `location` functions of relay query builder API
| -rw-r--r-- | mullvad-relay-selector/src/relay_selector/query.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/mullvad-relay-selector/src/relay_selector/query.rs b/mullvad-relay-selector/src/relay_selector/query.rs index 162865368a..1f0e393ac1 100644 --- a/mullvad-relay-selector/src/relay_selector/query.rs +++ b/mullvad-relay-selector/src/relay_selector/query.rs @@ -539,8 +539,8 @@ pub mod builder { // [`WireguardRelayQuery`] & [`OpenVpnRelayQuery`] impl<VpnProtocol> RelayQueryBuilder<VpnProtocol> { /// Configure the [`LocationConstraint`] to use. - pub fn location(mut self, location: GeographicLocationConstraint) -> Self { - self.query.location = Constraint::Only(LocationConstraint::from(location)); + pub fn location(mut self, location: impl Into<LocationConstraint>) -> Self { + self.query.location = Constraint::Only(location.into()); self } @@ -732,9 +732,8 @@ pub mod builder { { /// Set the entry location in a multihop configuration. This requires /// multihop to be enabled. - pub fn entry(mut self, location: GeographicLocationConstraint) -> Self { - self.query.wireguard_constraints.entry_location = - Constraint::Only(LocationConstraint::from(location)); + pub fn entry(mut self, location: impl Into<LocationConstraint>) -> Self { + self.query.wireguard_constraints.entry_location = Constraint::Only(location.into()); self } } |
