diff options
| author | Jonathan <jonathan@mullvad.net> | 2023-06-28 14:36:24 +0200 |
|---|---|---|
| committer | Jonathan <jonathan@mullvad.net> | 2023-06-29 15:00:10 +0200 |
| commit | 5f61ba4058337e6985cee99661a59a98ebff6dd0 (patch) | |
| tree | ba94b7e0829f2fd57a9974b4590af59e9937e5be /mullvad-cli/src/cmds/relay.rs | |
| parent | b4bf8124fbc30bf891f70f120265f30c490d1244 (diff) | |
| download | mullvadvpn-5f61ba4058337e6985cee99661a59a98ebff6dd0.tar.xz mullvadvpn-5f61ba4058337e6985cee99661a59a98ebff6dd0.zip | |
Add settings migration code, refactor and cleanup
Bump the settings version. Add code for migrating settings to new
version since it is now not backwards compatible.
Refactor LocationConstraint and related types to be more lean.
Cleanup issues and fix formatting.
Refactor LocationConstraint and add migration code
Diffstat (limited to 'mullvad-cli/src/cmds/relay.rs')
| -rw-r--r-- | mullvad-cli/src/cmds/relay.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mullvad-cli/src/cmds/relay.rs b/mullvad-cli/src/cmds/relay.rs index 1bb395c4e5..83f4ad4fdd 100644 --- a/mullvad-cli/src/cmds/relay.rs +++ b/mullvad-cli/src/cmds/relay.rs @@ -450,7 +450,7 @@ impl Relay { // The country field is assumed to be hostname due to CLI argument parsing find_relay_by_hostname(&countries, &location_constraint_args.country) { - Constraint::Only(LocationConstraint::Location { location: relay }) + Constraint::Only(LocationConstraint::Location(relay)) } else { let location_constraint: Constraint<GeographicLocationConstraint> = Constraint::from(location_constraint_args); @@ -468,7 +468,7 @@ impl Relay { } } } - location_constraint.map(|location| LocationConstraint::Location { location }) + location_constraint.map(LocationConstraint::Location) }; Self::update_constraints(RelaySettingsUpdate::Normal(RelayConstraintsUpdate { @@ -576,7 +576,7 @@ impl Relay { // The country field is assumed to be hostname due to CLI argument parsing wireguard_constraints.entry_location = if let Some(relay) = find_relay_by_hostname(&countries, &entry.country) { - Constraint::Only(LocationConstraint::Location { location: relay }) + Constraint::Only(LocationConstraint::Location(relay)) } else { Constraint::from(entry) }; |
