mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-03-23 18:01:23 +01:00
minor Swift 3 cleanup
This commit is contained in:
@@ -83,6 +83,24 @@ public enum MigrationResult: Hashable {
|
||||
}
|
||||
|
||||
|
||||
// MARK: Equatable
|
||||
|
||||
public static func == (lhs: MigrationResult, rhs: MigrationResult) -> Bool {
|
||||
|
||||
switch (lhs, rhs) {
|
||||
|
||||
case (.success(let migrationTypes1), .success(let migrationTypes2)):
|
||||
return migrationTypes1 == migrationTypes2
|
||||
|
||||
case (.failure(let error1), .failure(let error2)):
|
||||
return error1 == error2
|
||||
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// MARK: Hashable
|
||||
|
||||
public var hashValue: Int {
|
||||
@@ -116,21 +134,3 @@ public enum MigrationResult: Hashable {
|
||||
self = .failure(CoreStoreError(error))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// MARK: - SetupResult: Equatable
|
||||
|
||||
public func == (lhs: MigrationResult, rhs: MigrationResult) -> Bool {
|
||||
|
||||
switch (lhs, rhs) {
|
||||
|
||||
case (.success(let migrationTypes1), .success(let migrationTypes2)):
|
||||
return migrationTypes1 == migrationTypes2
|
||||
|
||||
case (.failure(let error1), .failure(let error2)):
|
||||
return error1 == error2
|
||||
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user