mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-03-20 00:24:26 +01:00
minor Swift 3 cleanup
This commit is contained in:
@@ -86,6 +86,24 @@ public enum SetupResult<T: StorageInterface>: Hashable {
|
||||
}
|
||||
|
||||
|
||||
// MARK: Equatable
|
||||
|
||||
public static func == <T: StorageInterface, U: StorageInterface>(lhs: SetupResult<T>, rhs: SetupResult<U>) -> Bool {
|
||||
|
||||
switch (lhs, rhs) {
|
||||
|
||||
case (.success(let storage1), .success(let storage2)):
|
||||
return storage1 === storage2
|
||||
|
||||
case (.failure(let error1), .failure(let error2)):
|
||||
return error1 == error2
|
||||
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// MARK: Hashable
|
||||
|
||||
public var hashValue: Int {
|
||||
@@ -118,21 +136,3 @@ public enum SetupResult<T: StorageInterface>: Hashable {
|
||||
self = .failure(CoreStoreError(error))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// MARK: - SetupResult: Equatable
|
||||
|
||||
public func == <T: StorageInterface, U: StorageInterface>(lhs: SetupResult<T>, rhs: SetupResult<U>) -> Bool {
|
||||
|
||||
switch (lhs, rhs) {
|
||||
|
||||
case (.success(let storage1), .success(let storage2)):
|
||||
return storage1 === storage2
|
||||
|
||||
case (.failure(let error1), .failure(let error2)):
|
||||
return error1 == error2
|
||||
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user