aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2020-12-09 14:35:21 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2020-12-09 14:35:21 +0100
commitd4fd17cd8f5b6d2b756d96a898a8b40d2ba3de9c (patch)
tree4dc8cbe676c4067bcf321e6eab4f335f4396976c
parentWireGuardKitGo: get rid of missing -Wno-unused-command-line-argument flag (diff)
downloadwireguard-apple-d4fd17cd8f5b6d2b756d96a898a8b40d2ba3de9c.tar.xz
wireguard-apple-d4fd17cd8f5b6d2b756d96a898a8b40d2ba3de9c.zip
global: fix remaining swiftlint violations
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--.swiftlint.yml1
-rw-r--r--Sources/WireGuardApp/UI/iOS/ViewController/TunnelEditTableViewController.swift2
-rw-r--r--Sources/WireGuardApp/UI/macOS/ViewController/TunnelDetailTableViewController.swift2
-rw-r--r--Sources/WireGuardKit/PacketTunnelSettingsGenerator.swift4
4 files changed, 5 insertions, 4 deletions
diff --git a/.swiftlint.yml b/.swiftlint.yml
index c9ee503..a63b4df 100644
--- a/.swiftlint.yml
+++ b/.swiftlint.yml
@@ -7,6 +7,7 @@ disabled_rules:
- type_body_length
- function_body_length
- nesting
+ - inclusive_language
opt_in_rules:
- empty_count
- empty_string
diff --git a/Sources/WireGuardApp/UI/iOS/ViewController/TunnelEditTableViewController.swift b/Sources/WireGuardApp/UI/iOS/ViewController/TunnelEditTableViewController.swift
index 5fa255d..2abce6f 100644
--- a/Sources/WireGuardApp/UI/iOS/ViewController/TunnelEditTableViewController.swift
+++ b/Sources/WireGuardApp/UI/iOS/ViewController/TunnelEditTableViewController.swift
@@ -266,7 +266,7 @@ extension TunnelEditTableViewController {
guard let self = self else { return }
let isAllowedIPsChanged = self.tunnelViewModel.updateDNSServersInAllowedIPsIfRequired(oldDNSServers: oldValue, newDNSServers: newValue)
if isAllowedIPsChanged {
- let section = self.sections.firstIndex { if case .peer(_) = $0 { return true } else { return false } }
+ let section = self.sections.firstIndex { if case .peer = $0 { return true } else { return false } }
if let section = section, let row = self.peerFields.firstIndex(of: .allowedIPs) {
self.tableView.reloadRows(at: [IndexPath(row: row, section: section)], with: .none)
}
diff --git a/Sources/WireGuardApp/UI/macOS/ViewController/TunnelDetailTableViewController.swift b/Sources/WireGuardApp/UI/macOS/ViewController/TunnelDetailTableViewController.swift
index 96637cd..3757cf2 100644
--- a/Sources/WireGuardApp/UI/macOS/ViewController/TunnelDetailTableViewController.swift
+++ b/Sources/WireGuardApp/UI/macOS/ViewController/TunnelDetailTableViewController.swift
@@ -246,7 +246,7 @@ class TunnelDetailTableViewController: NSViewController {
var modifiedRowIndices = IndexSet()
for (index, field) in fields.enumerated() {
guard let change = changes[field] else { continue }
- if case .modified(_) = change {
+ if case .modified = change {
let row = modelRowsInSection[0 ..< index].filter { $0.isVisible }.count
modifiedRowIndices.insert(rowOffset + row)
}
diff --git a/Sources/WireGuardKit/PacketTunnelSettingsGenerator.swift b/Sources/WireGuardKit/PacketTunnelSettingsGenerator.swift
index 1e21490..9efe1fa 100644
--- a/Sources/WireGuardKit/PacketTunnelSettingsGenerator.swift
+++ b/Sources/WireGuardKit/PacketTunnelSettingsGenerator.swift
@@ -31,7 +31,7 @@ class PacketTunnelSettingsGenerator {
switch result {
case .success(.some(let endpoint)):
- if case .name(_, _) = endpoint.host { assert(false, "Endpoint is not resolved") }
+ if case .name = endpoint.host { assert(false, "Endpoint is not resolved") }
wgSettings.append("endpoint=\(endpoint.stringRepresentation)\n")
case .success(.none):
break
@@ -58,7 +58,7 @@ class PacketTunnelSettingsGenerator {
wgSettings.append("preshared_key=\(preSharedKey)\n")
}
if let endpoint = try? resolvedEndpoints[index]?.withReresolvedIP() {
- if case .name(_, _) = endpoint.host { assert(false, "Endpoint is not resolved") }
+ if case .name = endpoint.host { assert(false, "Endpoint is not resolved") }
wgSettings.append("endpoint=\(endpoint.stringRepresentation)\n")
}
let persistentKeepAlive = peer.persistentKeepAlive ?? 0