From 7b9d4cb9e35a88f13face71543ce4773102fe224 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Fri, 21 Dec 2018 23:34:56 +0100 Subject: Nuke trailing spaces Signed-off-by: Jason A. Donenfeld --- WireGuard/WireGuard/Tunnel/TunnelErrors.swift | 2 +- WireGuard/WireGuard/Tunnel/TunnelStatus.swift | 2 +- WireGuard/WireGuard/Tunnel/TunnelsManager.swift | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'WireGuard/WireGuard/Tunnel') diff --git a/WireGuard/WireGuard/Tunnel/TunnelErrors.swift b/WireGuard/WireGuard/Tunnel/TunnelErrors.swift index 9b2b574..77b0410 100644 --- a/WireGuard/WireGuard/Tunnel/TunnelErrors.swift +++ b/WireGuard/WireGuard/Tunnel/TunnelErrors.swift @@ -53,7 +53,7 @@ enum TunnelsManagerActivationAttemptError: WireGuardAppError { enum TunnelsManagerActivationError: WireGuardAppError { case activationFailed(wasOnDemandEnabled: Bool) case activationFailedWithExtensionError(title: String, message: String, wasOnDemandEnabled: Bool) - + var alertText: AlertText { switch self { case .activationFailed(let wasOnDemandEnabled): diff --git a/WireGuard/WireGuard/Tunnel/TunnelStatus.swift b/WireGuard/WireGuard/Tunnel/TunnelStatus.swift index 9f03417..cfa1307 100644 --- a/WireGuard/WireGuard/Tunnel/TunnelStatus.swift +++ b/WireGuard/WireGuard/Tunnel/TunnelStatus.swift @@ -12,7 +12,7 @@ import NetworkExtension case reasserting // Not a possible state at present case restarting // Restarting tunnel (done after saving modifications to an active tunnel) case waiting // Waiting for another tunnel to be brought down - + init(from systemStatus: NEVPNStatus) { switch systemStatus { case .connected: diff --git a/WireGuard/WireGuard/Tunnel/TunnelsManager.swift b/WireGuard/WireGuard/Tunnel/TunnelsManager.swift index 903dfad..5fa8e7e 100644 --- a/WireGuard/WireGuard/Tunnel/TunnelsManager.swift +++ b/WireGuard/WireGuard/Tunnel/TunnelsManager.swift @@ -41,7 +41,7 @@ class TunnelsManager { completionHandler(.failure(TunnelsManagerError.systemErrorOnListingTunnels(systemError: error))) return } - + let tunnelManagers = managers ?? [] tunnelManagers.forEach { tunnelManager in if (tunnelManager.protocolConfiguration as? NETunnelProviderProtocol)?.migrateConfigurationIfNeeded() == true { @@ -78,9 +78,9 @@ class TunnelsManager { completionHandler(.failure(TunnelsManagerError.systemErrorOnAddTunnel(systemError: error!))) return } - + guard let self = self else { return } - + let tunnel = TunnelContainer(tunnel: tunnelProviderManager) self.tunnels.append(tunnel) self.tunnels.sort { $0.name < $1.name } @@ -126,7 +126,7 @@ class TunnelsManager { tunnelProviderManager.protocolConfiguration = NETunnelProviderProtocol(tunnelConfiguration: tunnelConfiguration) tunnelProviderManager.localizedDescription = (tunnelConfiguration).interface.name tunnelProviderManager.isEnabled = true - + let isActivatingOnDemand = !tunnelProviderManager.isOnDemandEnabled && activateOnDemandSetting.isActivateOnDemandEnabled activateOnDemandSetting.apply(on: tunnelProviderManager) @@ -137,7 +137,7 @@ class TunnelsManager { return } guard let self = self else { return } - + if isNameChanged { let oldIndex = self.tunnels.firstIndex(of: tunnel)! self.tunnels.sort { $0.name < $1.name } @@ -351,11 +351,11 @@ class TunnelContainer: NSObject { var tunnelConfiguration: TunnelConfiguration? { return (tunnelProvider.protocolConfiguration as? NETunnelProviderProtocol)?.tunnelConfiguration(name: tunnelProvider.localizedDescription) } - + var activateOnDemandSetting: ActivateOnDemandSetting { return ActivateOnDemandSetting(from: tunnelProvider) } - + init(tunnel: NETunnelProviderManager) { name = tunnel.localizedDescription ?? "Unnamed" let status = TunnelStatus(from: tunnel.connection.status) -- cgit v1.2.3-59-g8ed1b