global: fix remaining swiftlint violations
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
d875266db5
commit
d4fd17cd8f
|
@ -7,6 +7,7 @@ disabled_rules:
|
|||
- type_body_length
|
||||
- function_body_length
|
||||
- nesting
|
||||
- inclusive_language
|
||||
opt_in_rules:
|
||||
- empty_count
|
||||
- empty_string
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue