diff options
| author | David Lönnhager <david.l@mullvad.net> | 2026-04-16 15:42:40 +0200 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2026-04-17 13:14:27 +0200 |
| commit | f41ccbe8f788b1f25f00a46efce084168f43d8e0 (patch) | |
| tree | f337593e2415367f2c3c6028b038dc8c552a59f7 | |
| parent | b695190e5fafbd6a54078774ede8dad0d328587d (diff) | |
| download | mullvadvpn-f41ccbe8f788b1f25f00a46efce084168f43d8e0.tar.xz mullvadvpn-f41ccbe8f788b1f25f00a46efce084168f43d8e0.zip | |
Fix clippy lints after 1.95 update
| -rw-r--r-- | android/translations-converter/src/main.rs | 4 | ||||
| -rw-r--r-- | mullvad-cli/src/cmds/relay.rs | 2 | ||||
| -rw-r--r-- | mullvad-daemon/src/lib.rs | 12 | ||||
| -rw-r--r-- | mullvad-daemon/src/system_service.rs | 8 | ||||
| -rw-r--r-- | mullvad-encrypted-dns-proxy/src/state.rs | 2 | ||||
| -rw-r--r-- | talpid-core/src/split_tunnel/windows/mod.rs | 6 | ||||
| -rw-r--r-- | talpid-routing/src/windows/get_best_default_route.rs | 2 | ||||
| -rw-r--r-- | test/test-manager/src/tests/tunnel.rs | 2 | ||||
| -rw-r--r-- | test/test-manager/src/tests/ui.rs | 6 | ||||
| -rw-r--r-- | test/test-runner/src/logging.rs | 10 |
10 files changed, 23 insertions, 31 deletions
diff --git a/android/translations-converter/src/main.rs b/android/translations-converter/src/main.rs index eb05633e5b..ca88408ebb 100644 --- a/android/translations-converter/src/main.rs +++ b/android/translations-converter/src/main.rs @@ -212,8 +212,8 @@ fn add_missing_plurals( gettext::append_to_template( template_path, missing_plurals - .into_iter() - .filter_map(|(_, p)| plural_resources.iter().find(|plural| plural.name == p.name)) + .into_values() + .filter_map(|p| plural_resources.iter().find(|plural| plural.name == p.name)) .cloned() .inspect(|plural| { let other_item = &plural diff --git a/mullvad-cli/src/cmds/relay.rs b/mullvad-cli/src/cmds/relay.rs index c87684f8f3..5cd190ee78 100644 --- a/mullvad-cli/src/cmds/relay.rs +++ b/mullvad-cli/src/cmds/relay.rs @@ -500,7 +500,7 @@ impl Relay { let providers = if providers[0].eq_ignore_ascii_case("any") { Constraint::Any } else { - Constraint::Only(Providers::new(providers.into_iter()).unwrap()) + Constraint::Only(Providers::new(providers).unwrap()) }; Self::update_constraints(|constraints| { constraints.providers = providers; diff --git a/mullvad-daemon/src/lib.rs b/mullvad-daemon/src/lib.rs index becdd3039c..1e6cae1d09 100644 --- a/mullvad-daemon/src/lib.rs +++ b/mullvad-daemon/src/lib.rs @@ -1681,12 +1681,12 @@ impl Daemon { log::info!("Disconnecting because account number was cleared"); self.set_target_state(TargetState::Unsecured).await; } - AccountEvent::Device(PrivateDeviceEvent::Revoked) => { - // If we're currently in a secured state, reconnect to make sure we immediately - // enter the error state. - if *self.target_state == TargetState::Secured { - self.connect_tunnel(); - } + // If we're currently in a secured state, reconnect to make sure we immediately + // enter the error state. + AccountEvent::Device(PrivateDeviceEvent::Revoked) + if *self.target_state == TargetState::Secured => + { + self.connect_tunnel(); } AccountEvent::Device(PrivateDeviceEvent::RotatedKey(_)) => { self.schedule_reconnect(WG_RECONNECT_DELAY); diff --git a/mullvad-daemon/src/system_service.rs b/mullvad-daemon/src/system_service.rs index 5f0c4a0f82..b1d6c95c13 100644 --- a/mullvad-daemon/src/system_service.rs +++ b/mullvad-daemon/src/system_service.rs @@ -159,10 +159,10 @@ fn start_event_monitor( } _ => (), }, - ServiceControl::SessionChange(details) => { - if details.reason == SessionChangeReason::SessionLogoff { - hibernation_detector.register_logoff(details.notification.session_id); - } + ServiceControl::SessionChange(details) + if details.reason == SessionChangeReason::SessionLogoff => + { + hibernation_detector.register_logoff(details.notification.session_id); } _ => (), } diff --git a/mullvad-encrypted-dns-proxy/src/state.rs b/mullvad-encrypted-dns-proxy/src/state.rs index 8b6c3c9886..f27b81a213 100644 --- a/mullvad-encrypted-dns-proxy/src/state.rs +++ b/mullvad-encrypted-dns-proxy/src/state.rs @@ -62,7 +62,7 @@ impl EncryptedDnsProxyState { pub async fn fetch_configs(&mut self, domain: &str) -> Result<(), FetchConfigError> { match resolve_default_config(domain).await { Ok(new_configs) => { - self.configurations = HashSet::from_iter(new_configs.into_iter()); + self.configurations = HashSet::from_iter(new_configs); } Err(err) => { log::error!("Failed to fetch a new proxy configuration: {err:?}"); diff --git a/talpid-core/src/split_tunnel/windows/mod.rs b/talpid-core/src/split_tunnel/windows/mod.rs index cb5016df84..1e613819ab 100644 --- a/talpid-core/src/split_tunnel/windows/mod.rs +++ b/talpid-core/src/split_tunnel/windows/mod.rs @@ -575,10 +575,8 @@ impl InitializedSplitTunnelState { }, ); } - EventId::StopSplittingProcess => { - if pids.remove(&process_id).is_none() { - log::error!("Inconsistent process tree: {process_id} was not found"); - } + EventId::StopSplittingProcess if pids.remove(&process_id).is_none() => { + log::error!("Inconsistent process tree: {process_id} was not found"); } _ => (), } diff --git a/talpid-routing/src/windows/get_best_default_route.rs b/talpid-routing/src/windows/get_best_default_route.rs index 5292359b71..c6b6eac20d 100644 --- a/talpid-routing/src/windows/get_best_default_route.rs +++ b/talpid-routing/src/windows/get_best_default_route.rs @@ -82,7 +82,7 @@ pub fn get_best_default_route(family: AddressFamily) -> Result<Option<InterfaceA // We previously filtered out all inactive routes so we only need to sort by ascending // effective_metric - annotated.sort_by(|lhs, rhs| lhs.effective_metric.cmp(&rhs.effective_metric)); + annotated.sort_by_key(|r| r.effective_metric); annotated .first() diff --git a/test/test-manager/src/tests/tunnel.rs b/test/test-manager/src/tests/tunnel.rs index ce7510062f..70cb393681 100644 --- a/test/test-manager/src/tests/tunnel.rs +++ b/test/test-manager/src/tests/tunnel.rs @@ -450,7 +450,7 @@ async fn check_tunnel_psk( .await .expect("failed to get tun name"); let output = rpc - .exec("wg", vec!["show", &name].into_iter()) + .exec("wg", vec!["show", &name]) .await .expect("failed to run wg"); let parsed_output = std::str::from_utf8(&output.stdout).expect("non-utf8 output"); diff --git a/test/test-manager/src/tests/ui.rs b/test/test-manager/src/tests/ui.rs index 713e5046b4..7ea413f761 100644 --- a/test/test-manager/src/tests/ui.rs +++ b/test/test-manager/src/tests/ui.rs @@ -67,11 +67,7 @@ pub async fn run_test_env< log::info!("Running UI tests: {params:?}"); let result = rpc - .exec_env( - bin_path.to_string_lossy().into_owned(), - new_params.into_iter(), - env, - ) + .exec_env(bin_path.to_string_lossy().into_owned(), new_params, env) .await?; if !result.success() { diff --git a/test/test-runner/src/logging.rs b/test/test-runner/src/logging.rs index 8dbcaf4db5..d7c9843dea 100644 --- a/test/test-runner/src/logging.rs +++ b/test/test-runner/src/logging.rs @@ -47,12 +47,10 @@ impl log::Log for StdOutBuffer { .send(Output::Warning(format!("{}", record.args()))) .unwrap(); } - Level::Info => { - if !record.metadata().target().contains("tarpc") { - self.1 - .send(Output::Info(format!("{}", record.args()))) - .unwrap(); - } + Level::Info if !record.metadata().target().contains("tarpc") => { + self.1 + .send(Output::Info(format!("{}", record.args()))) + .unwrap(); } _ => (), } |
