aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/ZipArchive/ZipImporter.swift
diff options
context:
space:
mode:
authorEric Kuck <eric@bluelinelabs.com>2018-12-12 12:28:27 -0600
committerEric Kuck <eric@bluelinelabs.com>2018-12-12 12:28:27 -0600
commitd06cff2a360839c67ce42a695f01bb933ba820c0 (patch)
tree3aa166de8c75947345b9bfb8398ee8b7c6b581c7 /WireGuard/WireGuard/ZipArchive/ZipImporter.swift
parentAdded swiftlint and fixed all errors (and a bunch, but not all, warnings) (diff)
downloadwireguard-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/ZipImporter.swift')
-rw-r--r--WireGuard/WireGuard/ZipArchive/ZipImporter.swift12
1 files changed, 6 insertions, 6 deletions
diff --git a/WireGuard/WireGuard/ZipArchive/ZipImporter.swift b/WireGuard/WireGuard/ZipArchive/ZipImporter.swift
index 194dc0e..e2767f2 100644
--- a/WireGuard/WireGuard/ZipArchive/ZipImporter.swift
+++ b/WireGuard/WireGuard/ZipArchive/ZipImporter.swift
@@ -7,7 +7,7 @@ enum ZipImporterError: WireGuardAppError {
case noTunnelsInZipArchive
func alertText() -> (String, String)? {
- switch (self) {
+ switch self {
case .noTunnelsInZipArchive:
return ("No tunnels in zip archive", "No .conf tunnel files were found inside the zip archive.")
}
@@ -23,17 +23,17 @@ class ZipImporter {
for (index, unarchivedFile) in unarchivedFiles.enumerated().reversed() {
let fileBaseName = unarchivedFile.fileBaseName
let trimmedName = fileBaseName.trimmingCharacters(in: .whitespacesAndNewlines)
- if (!trimmedName.isEmpty) {
+ if !trimmedName.isEmpty {
unarchivedFiles[index].fileBaseName = trimmedName
} else {
unarchivedFiles.remove(at: index)
}
}
- if (unarchivedFiles.isEmpty) {
+ if unarchivedFiles.isEmpty {
throw ZipImporterError.noTunnelsInZipArchive
}
- } catch (let error as WireGuardAppError) {
+ } catch let error as WireGuardAppError {
DispatchQueue.main.async { completion(.failure(error)) }
return
} catch {
@@ -41,9 +41,9 @@ class ZipImporter {
}
unarchivedFiles.sort { $0.fileBaseName < $1.fileBaseName }
- var configs = Array<TunnelConfiguration?>(repeating: nil, count: unarchivedFiles.count)
+ var configs: [TunnelConfiguration?] = Array(repeating: nil, count: unarchivedFiles.count)
for (index, file) in unarchivedFiles.enumerated() {
- if (index > 0 && file == unarchivedFiles[index - 1]) {
+ if index > 0 && file == unarchivedFiles[index - 1] {
continue
}
guard let fileContents = String(data: file.contents, encoding: .utf8) else {