From 8e1e6c8e93f504576adfd2f1925b9c10359e470a Mon Sep 17 00:00:00 2001 From: Markus Pettersson Date: Thu, 28 Sep 2023 09:41:53 +0200 Subject: [PATCH] Fix `clippy` lint Fix `clippy` lint "unused `async` for function with no await statements" --- mullvad-daemon/src/access_method.rs | 2 +- mullvad-daemon/src/lib.rs | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/mullvad-daemon/src/access_method.rs b/mullvad-daemon/src/access_method.rs index 73fd35fcbd4b..ea096cf5ba64 100644 --- a/mullvad-daemon/src/access_method.rs +++ b/mullvad-daemon/src/access_method.rs @@ -102,7 +102,7 @@ where /// Return the [`AccessMethodSetting`] which is currently used to access the /// Mullvad API. - pub async fn get_current_access_method(&mut self) -> Result { + pub fn get_current_access_method(&mut self) -> Result { let connections_modes = self.connection_modes.lock().unwrap(); Ok(connections_modes.peek()) } diff --git a/mullvad-daemon/src/lib.rs b/mullvad-daemon/src/lib.rs index 0a00639c09ed..3def0855c207 100644 --- a/mullvad-daemon/src/lib.rs +++ b/mullvad-daemon/src/lib.rs @@ -1076,7 +1076,7 @@ where } RemoveApiAccessMethod(tx, method) => self.on_remove_api_access_method(tx, method).await, UpdateApiAccessMethod(tx, method) => self.on_update_api_access_method(tx, method).await, - GetCurrentAccessMethod(tx) => self.on_get_current_api_access_method(tx).await, + GetCurrentAccessMethod(tx) => self.on_get_current_api_access_method(tx), SetApiAccessMethod(tx, method) => self.on_set_api_access_method(tx, method), GetApiAddresses(tx) => self.on_get_api_addresses(tx).await, IsPerformingPostUpgrade(tx) => self.on_is_performing_post_upgrade(tx), @@ -2307,13 +2307,9 @@ where Self::oneshot_send(tx, result, "update_api_access_method response"); } - async fn on_get_current_api_access_method( - &mut self, - tx: ResponseTx, - ) { + fn on_get_current_api_access_method(&mut self, tx: ResponseTx) { let result = self .get_current_access_method() - .await .map_err(Error::AccessMethodError); Self::oneshot_send(tx, result, "get_current_api_access_method response"); }