Created
February 28, 2018 09:26
-
-
Save vialyx/34b94f71640a4c88fb62b899f60af65e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct User { | |
let id: Int | |
let name: String | |
} | |
extension User: Hashable { | |
var hashValue: Int { | |
return id | |
} | |
static func ==(lhs: User, rhs: User) -> Bool { | |
return lhs.id == rhs.id | |
} | |
} | |
var users: Set<User> = [] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment