Skip to content

Commit 18f8fe5

Browse files
committed
Model.BetaGroup + Hashable, Equatable
1 parent 58be826 commit 18f8fe5

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

Sources/Model/BetaGroup.swift

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,21 @@ public struct BetaGroup: Codable, Equatable {
3838
self.testers = testers
3939
}
4040
}
41+
42+
extension BetaGroup: Hashable {
43+
public static func == (lhs: BetaGroup, rhs: BetaGroup) -> Bool {
44+
return lhs.id == rhs.id &&
45+
lhs.groupName == rhs.groupName &&
46+
lhs.publicLinkEnabled == rhs.publicLinkEnabled &&
47+
lhs.publicLinkLimit == rhs.publicLinkLimit &&
48+
lhs.publicLinkLimitEnabled == rhs.publicLinkLimitEnabled
49+
}
50+
51+
public func hash(into hasher: inout Hasher) {
52+
hasher.combine(id)
53+
hasher.combine(groupName)
54+
hasher.combine(publicLinkEnabled)
55+
hasher.combine(publicLinkLimit)
56+
hasher.combine(publicLinkLimitEnabled)
57+
}
58+
}

0 commit comments

Comments
 (0)