diff options
| author | jonathan <jonathan@mullvad.net> | 2022-06-10 10:22:44 +0200 |
|---|---|---|
| committer | jonathan <jonathan@mullvad.net> | 2022-06-13 09:32:53 +0200 |
| commit | 08b60d4ac77d5f58649930ccd0770e490b732864 (patch) | |
| tree | 06c6940021736480858b8350edb04675d564da4b /mullvad-daemon/src | |
| parent | 1065db6ec3e2e0485bd39a5730942071f5cdbaf4 (diff) | |
| download | mullvadvpn-08b60d4ac77d5f58649930ccd0770e490b732864.tar.xz mullvadvpn-08b60d4ac77d5f58649930ccd0770e490b732864.zip | |
Perform a clippy --fix
This is a giant commit which performs only a clippy --fix.
Auditing can happen in two ways, either by reading every line or by
running a `cargo clippy --fix` on the previous commit and make sure that
the result is the same.
Diffstat (limited to 'mullvad-daemon/src')
| -rw-r--r-- | mullvad-daemon/src/api.rs | 4 | ||||
| -rw-r--r-- | mullvad-daemon/src/device/mod.rs | 13 | ||||
| -rw-r--r-- | mullvad-daemon/src/logging.rs | 2 | ||||
| -rw-r--r-- | mullvad-daemon/src/migrations/account_history.rs | 1 | ||||
| -rw-r--r-- | mullvad-daemon/src/migrations/v1.rs | 1 | ||||
| -rw-r--r-- | mullvad-daemon/src/migrations/v2.rs | 1 | ||||
| -rw-r--r-- | mullvad-daemon/src/migrations/v3.rs | 1 | ||||
| -rw-r--r-- | mullvad-daemon/src/migrations/v4.rs | 1 | ||||
| -rw-r--r-- | mullvad-daemon/src/migrations/v5.rs | 1 |
9 files changed, 8 insertions, 17 deletions
diff --git a/mullvad-daemon/src/api.rs b/mullvad-daemon/src/api.rs index f2b8708ae6..fe718c441a 100644 --- a/mullvad-daemon/src/api.rs +++ b/mullvad-daemon/src/api.rs @@ -94,7 +94,7 @@ impl Stream for ApiConnectionModeProvider { config })); - return self.poll_next(cx); + self.poll_next(cx) } } @@ -148,7 +148,7 @@ impl ApiEndpointUpdaterHandle { }; let (result_tx, result_rx) = oneshot::channel(); let _ = tunnel_tx.unbounded_send(TunnelCommand::AllowEndpoint( - get_allowed_endpoint(address.clone()), + get_allowed_endpoint(address), result_tx, )); // Wait for the firewall policy to be updated. diff --git a/mullvad-daemon/src/device/mod.rs b/mullvad-daemon/src/device/mod.rs index a0e3bed908..93dbac49ca 100644 --- a/mullvad-daemon/src/device/mod.rs +++ b/mullvad-daemon/src/device/mod.rs @@ -316,8 +316,7 @@ impl AccountManagerHandle { } pub async fn logout(&self) -> Result<(), Error> { - self.send_command(|tx| AccountManagerCommand::Logout(tx)) - .await + self.send_command(AccountManagerCommand::Logout).await } pub async fn set(&self, data: PrivateAccountAndDevice) -> Result<(), Error> { @@ -326,18 +325,16 @@ impl AccountManagerHandle { } pub async fn data(&self) -> Result<PrivateDeviceState, Error> { - self.send_command(|tx| AccountManagerCommand::GetData(tx)) - .await + self.send_command(AccountManagerCommand::GetData).await } pub async fn data_after_login(&self) -> Result<PrivateDeviceState, Error> { - self.send_command(|tx| AccountManagerCommand::GetDataAfterLogin(tx)) + self.send_command(AccountManagerCommand::GetDataAfterLogin) .await } pub async fn rotate_key(&self) -> Result<(), Error> { - self.send_command(|tx| AccountManagerCommand::RotateKey(tx)) - .await + self.send_command(AccountManagerCommand::RotateKey).await } pub async fn set_rotation_interval(&self, interval: RotationInterval) -> Result<(), Error> { @@ -346,7 +343,7 @@ impl AccountManagerHandle { } pub async fn validate_device(&self) -> Result<(), Error> { - self.send_command(|tx| AccountManagerCommand::ValidateDevice(tx)) + self.send_command(AccountManagerCommand::ValidateDevice) .await } diff --git a/mullvad-daemon/src/logging.rs b/mullvad-daemon/src/logging.rs index 597643fe26..cd58619108 100644 --- a/mullvad-daemon/src/logging.rs +++ b/mullvad-daemon/src/logging.rs @@ -137,7 +137,7 @@ impl Formatter { if self.output_timestamp { DATE_TIME_FORMAT_STR } else { - &"" + "" } } diff --git a/mullvad-daemon/src/migrations/account_history.rs b/mullvad-daemon/src/migrations/account_history.rs index 06a8326f04..22534c7f88 100644 --- a/mullvad-daemon/src/migrations/account_history.rs +++ b/mullvad-daemon/src/migrations/account_history.rs @@ -131,7 +131,6 @@ fn try_format_v1(bytes: &[u8]) -> Result<Option<AccountToken>> { #[cfg(test)] mod test { - use serde_json; pub const ACCOUNT_HISTORY_V1: &str = r#" { diff --git a/mullvad-daemon/src/migrations/v1.rs b/mullvad-daemon/src/migrations/v1.rs index 7f2a656c04..c8d6f9d585 100644 --- a/mullvad-daemon/src/migrations/v1.rs +++ b/mullvad-daemon/src/migrations/v1.rs @@ -76,7 +76,6 @@ fn version_matches(settings: &mut serde_json::Value) -> bool { #[cfg(test)] mod test { use super::{migrate, version_matches}; - use serde_json; pub const V2_SETTINGS: &str = r#" { diff --git a/mullvad-daemon/src/migrations/v2.rs b/mullvad-daemon/src/migrations/v2.rs index 585bc16cc1..e91a0d08e8 100644 --- a/mullvad-daemon/src/migrations/v2.rs +++ b/mullvad-daemon/src/migrations/v2.rs @@ -73,7 +73,6 @@ fn version_matches(settings: &mut serde_json::Value) -> bool { #[cfg(test)] mod test { use super::{migrate, version_matches}; - use serde_json; const V2_SETTINGS: &str = r#" { diff --git a/mullvad-daemon/src/migrations/v3.rs b/mullvad-daemon/src/migrations/v3.rs index dd44505103..cf8631e121 100644 --- a/mullvad-daemon/src/migrations/v3.rs +++ b/mullvad-daemon/src/migrations/v3.rs @@ -94,7 +94,6 @@ fn version_matches(settings: &mut serde_json::Value) -> bool { #[cfg(test)] mod test { use super::{migrate, version_matches}; - use serde_json; pub const V3_SETTINGS: &str = r#" { diff --git a/mullvad-daemon/src/migrations/v4.rs b/mullvad-daemon/src/migrations/v4.rs index 5bdfa7e5be..6908b13010 100644 --- a/mullvad-daemon/src/migrations/v4.rs +++ b/mullvad-daemon/src/migrations/v4.rs @@ -140,7 +140,6 @@ fn wg_protocol_from_port(port: u16) -> TransportProtocol { #[cfg(test)] mod test { use super::{migrate, version_matches}; - use serde_json; pub const V4_SETTINGS: &str = r#" { diff --git a/mullvad-daemon/src/migrations/v5.rs b/mullvad-daemon/src/migrations/v5.rs index ba12c5ae91..9f0fdc4b94 100644 --- a/mullvad-daemon/src/migrations/v5.rs +++ b/mullvad-daemon/src/migrations/v5.rs @@ -175,7 +175,6 @@ fn version_matches(settings: &mut serde_json::Value) -> bool { #[cfg(test)] mod test { use super::{migrate, version_matches}; - use serde_json; pub const V5_SETTINGS: &str = r#" { |
