mirror of
https://github.com/zhigang1992/GitHawk.git
synced 2026-04-29 12:35:00 +08:00
Merge pull request #1803 from GitHawkApp/synthesized-equatable
Synthesize Equatable conformances
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
struct Bookmark: Codable {
|
||||
struct Bookmark: Codable, Equatable {
|
||||
let type: NotificationType
|
||||
let name: String
|
||||
let owner: String
|
||||
@@ -35,18 +35,6 @@ struct Bookmark: Codable {
|
||||
}
|
||||
}
|
||||
|
||||
extension Bookmark: Equatable {
|
||||
static func ==(lhs: Bookmark, rhs: Bookmark) -> Bool {
|
||||
return lhs.type == rhs.type &&
|
||||
lhs.name == rhs.name &&
|
||||
lhs.owner == rhs.owner &&
|
||||
lhs.number == rhs.number &&
|
||||
lhs.title == rhs.title &&
|
||||
lhs.hasIssueEnabled == rhs.hasIssueEnabled &&
|
||||
lhs.defaultBranch == rhs.defaultBranch
|
||||
}
|
||||
}
|
||||
|
||||
extension Bookmark: Filterable {
|
||||
func match(query: String) -> Bool {
|
||||
let lowerQuery = query.lowercased()
|
||||
|
||||
@@ -14,12 +14,6 @@ struct FileChanges: Equatable {
|
||||
let additions: Int
|
||||
let deletions: Int
|
||||
let changedFiles: Int
|
||||
|
||||
static func == (lhs: FileChanges, rhs: FileChanges) -> Bool {
|
||||
return lhs.additions == rhs.additions
|
||||
&& lhs.deletions == rhs.deletions
|
||||
&& lhs.changedFiles == rhs.changedFiles
|
||||
}
|
||||
}
|
||||
|
||||
protocol IssueType {
|
||||
|
||||
@@ -8,18 +8,9 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
struct RepositoryDetails: Codable {
|
||||
struct RepositoryDetails: Codable, Equatable {
|
||||
let owner: String
|
||||
let name: String
|
||||
let defaultBranch: String
|
||||
let hasIssuesEnabled: Bool
|
||||
}
|
||||
|
||||
extension RepositoryDetails: Equatable {
|
||||
static func == (lhs: RepositoryDetails, rhs: RepositoryDetails) -> Bool {
|
||||
return lhs.owner == rhs.owner &&
|
||||
lhs.name == rhs.name &&
|
||||
lhs.defaultBranch == rhs.defaultBranch &&
|
||||
lhs.hasIssuesEnabled == rhs.hasIssuesEnabled
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,11 +73,6 @@ final class NSAttributedStringSizing: NSObject, ListDiffable {
|
||||
return attributedText.combineHash(with: width)
|
||||
}
|
||||
|
||||
public static func == (lhs: CacheKey, rhs: CacheKey) -> Bool {
|
||||
return lhs.width == rhs.width
|
||||
&& lhs.attributedText == rhs.attributedText
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static let globalSizeCache = LRUCache<CacheKey, CGSize>(
|
||||
|
||||
Reference in New Issue
Block a user