summaryrefslogtreecommitdiffhomepage
path: root/talpid-openvpn/src
diff options
context:
space:
mode:
Diffstat (limited to 'talpid-openvpn/src')
-rw-r--r--talpid-openvpn/src/lib.rs14
-rw-r--r--talpid-openvpn/src/mktemp.rs16
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
+ );
}
}
}