diff options
| author | Jonathan <jonathan@mullvad.net> | 2022-06-13 10:49:46 +0200 |
|---|---|---|
| committer | Jonathan <jonathan@mullvad.net> | 2022-06-21 14:31:40 +0200 |
| commit | d3da8745c8ff9e66d6698d8a239b8139dbe8abfe (patch) | |
| tree | 528a15026535b01bc3324892be783797aa64bbe4 /mullvad-setup/src | |
| parent | b6b80b9ffe6521a78ea6b2cdfd0e6965e67479fd (diff) | |
| download | mullvadvpn-d3da8745c8ff9e66d6698d8a239b8139dbe8abfe.tar.xz mullvadvpn-d3da8745c8ff9e66d6698d8a239b8139dbe8abfe.zip | |
Fix the large majority of clippy warnings
This commit fixes most of the remaining clippy warnings in the codebase.
These warnings were the more semantically difficult ones to fix.
There are some warnings that remain from the rebase that will be fixed
in the upcoming PR.
Diffstat (limited to 'mullvad-setup/src')
| -rw-r--r-- | mullvad-setup/src/main.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mullvad-setup/src/main.rs b/mullvad-setup/src/main.rs index b257d92080..9d353b78a6 100644 --- a/mullvad-setup/src/main.rs +++ b/mullvad-setup/src/main.rs @@ -2,7 +2,7 @@ use clap::{crate_authors, crate_description, crate_name, App}; use mullvad_api::{self, proxy::ApiConnectionMode}; use mullvad_management_interface::new_rpc_client; use mullvad_types::version::ParsedAppVersion; -use std::{path::PathBuf, process, time::Duration}; +use std::{path::PathBuf, process, str::FromStr, time::Duration}; use talpid_core::{ firewall::{self, Firewall}, future_retry::{constant_interval, retry_future_n}, @@ -133,7 +133,7 @@ async fn main() { async fn is_older_version(old_version: &str) -> Result<ExitStatus, Error> { let parsed_version = - ParsedAppVersion::from_str(old_version).ok_or(Error::ParseVersionStringError)?; + ParsedAppVersion::from_str(old_version).map_err(|_| Error::ParseVersionStringError)?; Ok(if parsed_version < *APP_VERSION { ExitStatus::Ok @@ -152,7 +152,7 @@ async fn prepare_restart() -> Result<(), Error> { async fn reset_firewall() -> Result<(), Error> { // Ensure that the daemon isn't running - if let Ok(_) = new_rpc_client().await { + if new_rpc_client().await.is_ok() { return Err(Error::DaemonIsRunning); } |
