mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-03-25 02:41:24 +01:00
deleted unnecessary Equatable and Hashable custom implementations
This commit is contained in:
@@ -68,40 +68,6 @@ 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 {
|
||||
|
||||
switch self {
|
||||
|
||||
case .success(let migrationTypes):
|
||||
return true.hashValue
|
||||
^ migrationTypes.map { $0.hashValue }.reduce(0, ^).hashValue
|
||||
|
||||
case .failure(let error):
|
||||
return false.hashValue ^ error.hashValue
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// MARK: Internal
|
||||
|
||||
internal init(_ migrationTypes: [MigrationType]) {
|
||||
|
||||
Reference in New Issue
Block a user