Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Commit bca4148

Browse files
authored
Merge pull request #1803 from GitHawkApp/synthesized-equatable
Synthesize Equatable conformances
2 parents a4f9816 + 1507b17 commit bca4148

File tree

4 files changed

+2
-34
lines changed

4 files changed

+2
-34
lines changed

Classes/Bookmark/Bookmark.swift

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import Foundation
1010

11-
struct Bookmark: Codable {
11+
struct Bookmark: Codable, Equatable {
1212
let type: NotificationType
1313
let name: String
1414
let owner: String
@@ -35,18 +35,6 @@ struct Bookmark: Codable {
3535
}
3636
}
3737

38-
extension Bookmark: Equatable {
39-
static func ==(lhs: Bookmark, rhs: Bookmark) -> Bool {
40-
return lhs.type == rhs.type &&
41-
lhs.name == rhs.name &&
42-
lhs.owner == rhs.owner &&
43-
lhs.number == rhs.number &&
44-
lhs.title == rhs.title &&
45-
lhs.hasIssueEnabled == rhs.hasIssueEnabled &&
46-
lhs.defaultBranch == rhs.defaultBranch
47-
}
48-
}
49-
5038
extension Bookmark: Filterable {
5139
func match(query: String) -> Bool {
5240
let lowerQuery = query.lowercased()

Classes/Issues/IssueType.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@ struct FileChanges: Equatable {
1414
let additions: Int
1515
let deletions: Int
1616
let changedFiles: Int
17-
18-
static func == (lhs: FileChanges, rhs: FileChanges) -> Bool {
19-
return lhs.additions == rhs.additions
20-
&& lhs.deletions == rhs.deletions
21-
&& lhs.changedFiles == rhs.changedFiles
22-
}
2317
}
2418

2519
protocol IssueType {

Classes/Repository/RepositoryDetails.swift

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,9 @@
88

99
import Foundation
1010

11-
struct RepositoryDetails: Codable {
11+
struct RepositoryDetails: Codable, Equatable {
1212
let owner: String
1313
let name: String
1414
let defaultBranch: String
1515
let hasIssuesEnabled: Bool
1616
}
17-
18-
extension RepositoryDetails: Equatable {
19-
static func == (lhs: RepositoryDetails, rhs: RepositoryDetails) -> Bool {
20-
return lhs.owner == rhs.owner &&
21-
lhs.name == rhs.name &&
22-
lhs.defaultBranch == rhs.defaultBranch &&
23-
lhs.hasIssuesEnabled == rhs.hasIssuesEnabled
24-
}
25-
}

Classes/Systems/NSAttributedStringSizing.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,6 @@ final class NSAttributedStringSizing: NSObject, ListDiffable {
7373
return attributedText.combineHash(with: width)
7474
}
7575

76-
public static func == (lhs: CacheKey, rhs: CacheKey) -> Bool {
77-
return lhs.width == rhs.width
78-
&& lhs.attributedText == rhs.attributedText
79-
}
80-
8176
}
8277

8378
private static let globalSizeCache = LRUCache<CacheKey, CGSize>(

0 commit comments

Comments
 (0)