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

Commit

Permalink
Merge pull request #1803 from GitHawkApp/synthesized-equatable
Browse files Browse the repository at this point in the history
Synthesize Equatable conformances
  • Loading branch information
rnystrom authored May 11, 2018
2 parents a4f9816 + 1507b17 commit bca4148
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 34 deletions.
14 changes: 1 addition & 13 deletions Classes/Bookmark/Bookmark.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

struct Bookmark: Codable {
struct Bookmark: Codable, Equatable {
let type: NotificationType
let name: String
let owner: String
Expand All @@ -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()
Expand Down
6 changes: 0 additions & 6 deletions Classes/Issues/IssueType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
11 changes: 1 addition & 10 deletions Classes/Repository/RepositoryDetails.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
5 changes: 0 additions & 5 deletions Classes/Systems/NSAttributedStringSizing.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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>(
Expand Down

0 comments on commit bca4148

Please sign in to comment.