diff options
author | 2018-12-12 12:28:27 -0600 | |
---|---|---|
committer | 2018-12-12 12:28:27 -0600 | |
commit | d06cff2a360839c67ce42a695f01bb933ba820c0 (patch) | |
tree | 3aa166de8c75947345b9bfb8398ee8b7c6b581c7 /WireGuard/WireGuard/ZipArchive/ZipExporter.swift | |
parent | Added swiftlint and fixed all errors (and a bunch, but not all, warnings) (diff) | |
download | wireguard-apple-d06cff2a360839c67ce42a695f01bb933ba820c0.tar.xz wireguard-apple-d06cff2a360839c67ce42a695f01bb933ba820c0.zip |
Tons more swiftlint warnings fixed. Still a few remaining.
Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
Diffstat (limited to 'WireGuard/WireGuard/ZipArchive/ZipExporter.swift')
-rw-r--r-- | WireGuard/WireGuard/ZipArchive/ZipExporter.swift | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/WireGuard/WireGuard/ZipArchive/ZipExporter.swift b/WireGuard/WireGuard/ZipArchive/ZipExporter.swift index f875e1b..b0e6b15 100644 --- a/WireGuard/WireGuard/ZipArchive/ZipExporter.swift +++ b/WireGuard/WireGuard/ZipArchive/ZipExporter.swift @@ -7,7 +7,7 @@ enum ZipExporterError: WireGuardAppError { case noTunnelsToExport func alertText() -> (String, String)? { - switch (self) { + switch self { case .noTunnelsToExport: return ("Nothing to export", "There are no tunnels to export") } @@ -18,7 +18,7 @@ class ZipExporter { static func exportConfigFiles(tunnelConfigurations: [TunnelConfiguration], to url: URL, completion: @escaping (WireGuardAppError?) -> Void) { - guard (!tunnelConfigurations.isEmpty) else { + guard !tunnelConfigurations.isEmpty else { completion(ZipExporterError.noTunnelsToExport) return } @@ -28,14 +28,14 @@ class ZipExporter { for tunnelConfiguration in tunnelConfigurations { if let contents = WgQuickConfigFileWriter.writeConfigFile(from: tunnelConfiguration) { let name = tunnelConfiguration.interface.name - if (name.isEmpty || name == lastTunnelName) { continue } + if name.isEmpty || name == lastTunnelName { continue } inputsToArchiver.append((fileName: "\(name).conf", contents: contents)) lastTunnelName = name } } do { try ZipArchive.archive(inputs: inputsToArchiver, to: url) - } catch (let error as WireGuardAppError) { + } catch let error as WireGuardAppError { DispatchQueue.main.async { completion(error) } return } catch { |