aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/Shared/Model/Endpoint.swift
diff options
context:
space:
mode:
Diffstat (limited to 'WireGuard/Shared/Model/Endpoint.swift')
-rw-r--r--WireGuard/Shared/Model/Endpoint.swift13
1 files changed, 13 insertions, 0 deletions
diff --git a/WireGuard/Shared/Model/Endpoint.swift b/WireGuard/Shared/Model/Endpoint.swift
index 03de1318..bcc74cf7 100644
--- a/WireGuard/Shared/Model/Endpoint.swift
+++ b/WireGuard/Shared/Model/Endpoint.swift
@@ -14,6 +14,19 @@ struct Endpoint {
}
}
+extension Endpoint: Equatable {
+ static func == (lhs: Endpoint, rhs: Endpoint) -> Bool {
+ return lhs.host == rhs.host && lhs.port == rhs.port
+ }
+}
+
+extension Endpoint: Hashable {
+ func hash(into hasher: inout Hasher) {
+ hasher.combine(host)
+ hasher.combine(port)
+ }
+}
+
extension Endpoint {
var stringRepresentation: String {
switch host {