Use auto equatable

This commit is contained in:
David Jennes
2018-09-20 01:29:38 +02:00
parent 831cdf5f36
commit 1704cd2ddf
3 changed files with 0 additions and 26 deletions

View File

@@ -37,11 +37,6 @@ public struct TemplateSyntaxError : Error, Equatable, CustomStringConvertible {
public init(_ description: String) { public init(_ description: String) {
self.init(reason: description) self.init(reason: description)
} }
public static func ==(lhs:TemplateSyntaxError, rhs:TemplateSyntaxError) -> Bool {
return lhs.description == rhs.description && lhs.token == rhs.token && lhs.stackTrace == rhs.stackTrace
}
} }
extension Error { extension Error {

View File

@@ -114,21 +114,4 @@ public enum Token : Equatable {
return sourceMap return sourceMap
} }
} }
}
public func == (lhs: Token, rhs: Token) -> Bool {
switch (lhs, rhs) {
case let (.text(lhsValue, lhsAt), .text(rhsValue, rhsAt)):
return lhsValue == rhsValue && lhsAt == rhsAt
case let (.variable(lhsValue, lhsAt), .variable(rhsValue, rhsAt)):
return lhsValue == rhsValue && lhsAt == rhsAt
case let (.block(lhsValue, lhsAt), .block(rhsValue, rhsAt)):
return lhsValue == rhsValue && lhsAt == rhsAt
case let (.comment(lhsValue, lhsAt), .comment(rhsValue, rhsAt)):
return lhsValue == rhsValue && lhsAt == rhsAt
default:
return false
}
} }

View File

@@ -128,10 +128,6 @@ public struct Variable : Equatable, Resolvable {
} }
} }
public func ==(lhs: Variable, rhs: Variable) -> Bool {
return lhs.variable == rhs.variable
}
/// A structure used to represet range of two integer values expressed as `from...to`. /// A structure used to represet range of two integer values expressed as `from...to`.
/// Values should be numbers (they will be converted to integers). /// Values should be numbers (they will be converted to integers).
/// Rendering this variable produces array from range `from...to`. /// Rendering this variable produces array from range `from...to`.