diff options
| author | Markus Pettersson <markus.pettersson@mullvad.net> | 2025-09-08 16:28:28 +0200 |
|---|---|---|
| committer | Markus Pettersson <markus.pettersson@mullvad.net> | 2025-09-08 16:33:35 +0200 |
| commit | 1c47b5fdadcc7f286ed251d083c8657ff6018fa4 (patch) | |
| tree | 25b020cf3cab680aec9faaec8fce222515a91a07 | |
| parent | 7e589578a517189bc77211c9f3c1c0696e76c2da (diff) | |
| download | mullvadvpn-1c47b5fdadcc7f286ed251d083c8657ff6018fa4.tar.xz mullvadvpn-1c47b5fdadcc7f286ed251d083c8657ff6018fa4.zip | |
Fix lint `clippy::collapsible_if`
| -rw-r--r-- | mullvad-daemon/src/lib.rs | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/mullvad-daemon/src/lib.rs b/mullvad-daemon/src/lib.rs index 1825c09d95..f371b9a91a 100644 --- a/mullvad-daemon/src/lib.rs +++ b/mullvad-daemon/src/lib.rs @@ -1562,18 +1562,17 @@ impl Daemon { error.display_chain_with_msg("Failed to update account history") ); } - if self.settings.update_default_location { - if let Err(e) = self + if self.settings.update_default_location + && let Err(e) = self .settings .update(move |settings| settings.update_default_location = false) .await .map_err(Error::SettingsError) - { - log::error!( - "{}", - e.display_chain_with_msg("Unable to save has_updated_default_country") - ); - } + { + log::error!( + "{}", + e.display_chain_with_msg("Unable to save has_updated_default_country") + ); } if *self.target_state == TargetState::Secured { log::debug!("Initiating tunnel restart because the account number changed"); @@ -2389,18 +2388,17 @@ impl Daemon { Self::oneshot_send(tx, Err(e), "set_relay_settings response"); } } - if self.settings.update_default_location { - if let Err(e) = self + if self.settings.update_default_location + && let Err(e) = self .settings .update(move |settings| settings.update_default_location = false) .await .map_err(Error::SettingsError) - { - log::error!( - "{}", - e.display_chain_with_msg("Unable to save has_updated_default_country") - ); - } + { + log::error!( + "{}", + e.display_chain_with_msg("Unable to save has_updated_default_country") + ); } } |
