aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/Shared/Model
diff options
context:
space:
mode:
authorEric Kuck <eric@bluelinelabs.com>2018-12-12 21:09:52 -0600
committerEric Kuck <eric@bluelinelabs.com>2018-12-12 21:09:52 -0600
commit8a916beb389f84e21ed1aaf0d246801cd6acd73c (patch)
tree59ad4609e551e3259a802591eba9346b16408873 /WireGuard/Shared/Model
parentMore linter warnings fixed, enabled more swiftlint rules, project cleanup (diff)
downloadwireguard-apple-8a916beb389f84e21ed1aaf0d246801cd6acd73c.tar.xz
wireguard-apple-8a916beb389f84e21ed1aaf0d246801cd6acd73c.zip
More formatting nits and cyclomatic complexity fixes
Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
Diffstat (limited to 'WireGuard/Shared/Model')
-rw-r--r--WireGuard/Shared/Model/Configuration.swift6
-rw-r--r--WireGuard/Shared/Model/IPAddressRange.swift4
2 files changed, 4 insertions, 6 deletions
diff --git a/WireGuard/Shared/Model/Configuration.swift b/WireGuard/Shared/Model/Configuration.swift
index 09fdd6b8..77dfe974 100644
--- a/WireGuard/Shared/Model/Configuration.swift
+++ b/WireGuard/Shared/Model/Configuration.swift
@@ -26,10 +26,10 @@ final class TunnelConfiguration: Codable {
struct InterfaceConfiguration: Codable {
var name: String
var privateKey: Data
- var addresses: [IPAddressRange] = []
+ var addresses = [IPAddressRange]()
var listenPort: UInt16?
var mtu: UInt16?
- var dns: [DNSServer] = []
+ var dns = [DNSServer]()
init(name: String, privateKey: Data) {
self.name = name
@@ -55,7 +55,7 @@ struct PeerConfiguration: Codable {
}
}
}
- var allowedIPs: [IPAddressRange] = []
+ var allowedIPs = [IPAddressRange]()
var endpoint: Endpoint?
var persistentKeepAlive: UInt16?
diff --git a/WireGuard/Shared/Model/IPAddressRange.swift b/WireGuard/Shared/Model/IPAddressRange.swift
index e3c14414..468e3aa5 100644
--- a/WireGuard/Shared/Model/IPAddressRange.swift
+++ b/WireGuard/Shared/Model/IPAddressRange.swift
@@ -75,9 +75,7 @@ extension IPAddressRange: Codable {
default: return nil
}
}()
- guard let ipAddress = ipAddressFromData else {
- throw DecodingError.invalidData
- }
+ guard let ipAddress = ipAddressFromData else { throw DecodingError.invalidData }
address = ipAddress
}
enum DecodingError: Error {