diff --git a/mullvad-daemon/src/lib.rs b/mullvad-daemon/src/lib.rs index 4c0be97bb681..79f08e8a0f09 100644 --- a/mullvad-daemon/src/lib.rs +++ b/mullvad-daemon/src/lib.rs @@ -1439,7 +1439,7 @@ impl Daemon { #[cfg(target_os = "android")] match event { AccessMethodEvent::New { setting, .. } => { - // On android mullvad-api invokes protect on a socket to send requests + // On android mullvad-api invokes protect on a socket to send requests // outside the tunnel let notifier = self.management_interface.notifier().clone(); tokio::spawn(async move { diff --git a/talpid-core/src/tunnel/mod.rs b/talpid-core/src/tunnel/mod.rs index c36e660aff11..a75f72509948 100644 --- a/talpid-core/src/tunnel/mod.rs +++ b/talpid-core/src/tunnel/mod.rs @@ -4,9 +4,9 @@ use futures::channel::oneshot; use std::path; #[cfg(not(target_os = "android"))] use talpid_routing::RouteManagerHandle; -pub use talpid_tunnel::{TunnelArgs, TunnelEvent, TunnelMetadata}; #[cfg(target_os = "android")] use talpid_tunnel::tun_provider; +pub use talpid_tunnel::{TunnelArgs, TunnelEvent, TunnelMetadata}; #[cfg(not(target_os = "android"))] use talpid_types::net::openvpn as openvpn_types; use talpid_types::net::{wireguard as wireguard_types, TunnelParameters}; @@ -53,40 +53,30 @@ impl Into for Error { Error::EnableIpv6Error => ErrorStateCause::Ipv6Unavailable, #[cfg(target_os = "android")] - Error::WireguardTunnelMonitoringError( - talpid_wireguard::Error::TunnelError( - talpid_wireguard::TunnelError::SetupTunnelDevice( - tun_provider::Error::OtherLegacyAlwaysOnVpn, - ), + Error::WireguardTunnelMonitoringError(talpid_wireguard::Error::TunnelError( + talpid_wireguard::TunnelError::SetupTunnelDevice( + tun_provider::Error::OtherLegacyAlwaysOnVpn, ), - ) => ErrorStateCause::OtherLegacyAlwaysOnVpn, + )) => ErrorStateCause::OtherLegacyAlwaysOnVpn, #[cfg(target_os = "android")] - Error::WireguardTunnelMonitoringError( - talpid_wireguard::Error::TunnelError( - talpid_wireguard::TunnelError::SetupTunnelDevice( - tun_provider::Error::OtherAlwaysOnApp { app_name }, - ), + Error::WireguardTunnelMonitoringError(talpid_wireguard::Error::TunnelError( + talpid_wireguard::TunnelError::SetupTunnelDevice( + tun_provider::Error::OtherAlwaysOnApp { app_name }, ), - ) => ErrorStateCause::OtherAlwaysOnApp { app_name }, + )) => ErrorStateCause::OtherAlwaysOnApp { app_name }, #[cfg(target_os = "android")] - Error::WireguardTunnelMonitoringError( - talpid_wireguard::Error::TunnelError( - talpid_wireguard::TunnelError::SetupTunnelDevice( - tun_provider::Error::NotPrepared, - ), - ), - ) => ErrorStateCause::NotPrepared, + Error::WireguardTunnelMonitoringError(talpid_wireguard::Error::TunnelError( + talpid_wireguard::TunnelError::SetupTunnelDevice(tun_provider::Error::NotPrepared), + )) => ErrorStateCause::NotPrepared, #[cfg(target_os = "android")] - Error::WireguardTunnelMonitoringError( - talpid_wireguard::Error::TunnelError( - talpid_wireguard::TunnelError::SetupTunnelDevice( - tun_provider::Error::InvalidDnsServers(addresses), - ), + Error::WireguardTunnelMonitoringError(talpid_wireguard::Error::TunnelError( + talpid_wireguard::TunnelError::SetupTunnelDevice( + tun_provider::Error::InvalidDnsServers(addresses), ), - ) => ErrorStateCause::InvalidDnsServers(addresses), + )) => ErrorStateCause::InvalidDnsServers(addresses), #[cfg(target_os = "windows")] error => match error.get_tunnel_device_error() { Some(error) => ErrorStateCause::CreateTunnelDevice { diff --git a/talpid-core/src/tunnel_state_machine/connecting_state.rs b/talpid-core/src/tunnel_state_machine/connecting_state.rs index c616d6c2058b..7387d51c03f4 100644 --- a/talpid-core/src/tunnel_state_machine/connecting_state.rs +++ b/talpid-core/src/tunnel_state_machine/connecting_state.rs @@ -215,7 +215,7 @@ impl ConnectingState { ) -> Self { let (event_tx, event_rx) = mpsc::unbounded(); let on_tunnel_event = - move |event| -> std::pin::Pin + Send>> { + move |event| -> std::pin::Pin + Send>> { let (tx, rx) = oneshot::channel(); let _ = event_tx.unbounded_send((event, tx)); Box::pin(async move { @@ -304,14 +304,14 @@ impl ConnectingState { None } error @ tunnel::Error::WireguardTunnelMonitoringError(..) - if !should_retry(&error, retry_attempt) => - { - log::error!( + if !should_retry(&error, retry_attempt) => + { + log::error!( "{}", error.display_chain_with_msg("Tunnel has stopped unexpectedly") ); - Some(ErrorStateCause::StartTunnelError) - } + Some(ErrorStateCause::StartTunnelError) + } error => { log::warn!( "{}",