1
1
mirror of https://github.com/github/semantic.git synced 2024-11-29 11:02:26 +03:00

Handle the zero-category case with a where clause.

This commit is contained in:
Rob Rix 2015-10-07 13:19:49 -04:00
parent 4bcc773fc6
commit ba650f8080

View File

@ -18,10 +18,10 @@ public enum Info: AlgebraicHashable, CustomDebugStringConvertible {
public var debugDescription: String {
switch self {
case let .Literal(s, c) where c.isEmpty:
return s
case let .Literal(s, c):
return c.isEmpty
? s
: s + " (" + c.map { String(reflecting: $0) }.joinWithSeparator(", ") + ")"
return s + " (" + c.map { String(reflecting: $0) }.joinWithSeparator(", ") + ")"
}
}
}