mirror of
https://github.com/github/semantic.git
synced 2024-12-11 08:45:48 +03:00
13 lines
277 B
Swift
13 lines
277 B
Swift
extension Optional {
|
|
static func equals(param: (Wrapped, Wrapped) -> Bool)(_ left: Wrapped?, _ right: Wrapped?) -> Bool {
|
|
switch (left, right) {
|
|
case let (.Some(a), .Some(b)):
|
|
return param(a, b)
|
|
case (.None, .None):
|
|
return true
|
|
default:
|
|
return false
|
|
}
|
|
}
|
|
}
|