1
1
mirror of https://github.com/github/semantic.git synced 2024-12-25 07:55:12 +03:00

Info is AlgebraicHashable.

This commit is contained in:
Rob Rix 2015-10-01 09:46:02 -04:00
parent cb5b7c0b33
commit 1635b8ab8a

View File

@ -1,4 +1,4 @@
public enum Info: Equatable {
public enum Info: AlgebraicHashable {
case Literal(String, Set<Category>)
public var categories: Set<Category> {
@ -7,6 +7,13 @@ public enum Info: Equatable {
return c
}
}
public var hash: Hash {
switch self {
case let .Literal(source, categories):
return Hash("Literal", Hash(source), Hash(categories))
}
}
}