diff options
| author | Markus Pettersson <markus.pettersson@mullvad.net> | 2025-07-15 13:09:41 +0200 |
|---|---|---|
| committer | Markus Pettersson <markus.pettersson@mullvad.net> | 2025-07-15 14:56:58 +0200 |
| commit | ebe328d1724a63c6d93df2155195ba7c5558fde2 (patch) | |
| tree | 78a6f14dc59eedea90f7065989ccf04164378dc5 /talpid-openvpn/src | |
| parent | de3b988970d47625cffb4497d4d425fa3a6d0a4b (diff) | |
| download | mullvadvpn-ebe328d1724a63c6d93df2155195ba7c5558fde2.tar.xz mullvadvpn-ebe328d1724a63c6d93df2155195ba7c5558fde2.zip | |
Fix `collapsible_if` clippy lint
Diffstat (limited to 'talpid-openvpn/src')
| -rw-r--r-- | talpid-openvpn/src/lib.rs | 14 | ||||
| -rw-r--r-- | talpid-openvpn/src/mktemp.rs | 16 |
2 files changed, 15 insertions, 15 deletions
diff --git a/talpid-openvpn/src/lib.rs b/talpid-openvpn/src/lib.rs index 29ec3d44bd..30103d59a4 100644 --- a/talpid-openvpn/src/lib.rs +++ b/talpid-openvpn/src/lib.rs @@ -543,14 +543,14 @@ impl<C: OpenVpnBuilder + Send + 'static> OpenVpnMonitor<C> { fn create_proxy_auth_file( proxy_settings: &Option<CustomProxy>, ) -> std::result::Result<Option<mktemp::TempFile>, io::Error> { - if let Some(CustomProxy::Socks5Remote(remote_proxy)) = proxy_settings { - if let Some(ref proxy_auth) = remote_proxy.auth { - return Ok(Some(Self::create_credentials_file( - proxy_auth.username(), - proxy_auth.password(), - )?)); - } + if let Some(CustomProxy::Socks5Remote(remote_proxy)) = proxy_settings + && let Some(ref proxy_auth) = remote_proxy.auth + { + let credentials_file = + Self::create_credentials_file(proxy_auth.username(), proxy_auth.password())?; + return Ok(Some(credentials_file)); } + Ok(None) } diff --git a/talpid-openvpn/src/mktemp.rs b/talpid-openvpn/src/mktemp.rs index 9e5709ce1f..c7c8454908 100644 --- a/talpid-openvpn/src/mktemp.rs +++ b/talpid-openvpn/src/mktemp.rs @@ -31,14 +31,14 @@ impl AsRef<Path> for TempFile { impl Drop for TempFile { fn drop(&mut self) { - if let Err(e) = fs::remove_file(&self.path) { - if e.kind() != io::ErrorKind::NotFound { - log::error!( - "Unable to remove temp file {}: {:?}", - self.path.display(), - e - ); - } + if let Err(e) = fs::remove_file(&self.path) + && e.kind() != io::ErrorKind::NotFound + { + log::error!( + "Unable to remove temp file {}: {:?}", + self.path.display(), + e + ); } } } |
