All models now Equatable

Signed-off-by: Eric Kuck <eric@bluelinelabs.com>
This commit is contained in:
Eric Kuck
2018-12-21 22:41:54 -06:00
parent d36e7e27ff
commit 0bec5b04b0
10 changed files with 100 additions and 1 deletions
+13
View File
@@ -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 {