Use synthesized Hashable, Equatable. Remove some extraneous public declarations.

This commit is contained in:
Brent Simmons 2018-08-25 17:03:10 -07:00
parent 9f78c3d8a5
commit 63b0dd3cfc
2 changed files with 7 additions and 21 deletions

View File

@ -11,21 +11,21 @@ import RSParser
import RSWeb import RSWeb
import RSCore import RSCore
public protocol FeedFinderDelegate: class { protocol FeedFinderDelegate: class {
func feedFinder(_: FeedFinder, didFindFeeds: Set<FeedSpecifier>) func feedFinder(_: FeedFinder, didFindFeeds: Set<FeedSpecifier>)
} }
public class FeedFinder { class FeedFinder {
fileprivate weak var delegate: FeedFinderDelegate? fileprivate weak var delegate: FeedFinderDelegate?
fileprivate var feedSpecifiers = [String: FeedSpecifier]() fileprivate var feedSpecifiers = [String: FeedSpecifier]()
fileprivate var didNotifyDelegate = false fileprivate var didNotifyDelegate = false
public var initialDownloadError: Error? var initialDownloadError: Error?
public var initialDownloadStatusCode = -1 var initialDownloadStatusCode = -1
public init(url: URL, delegate: FeedFinderDelegate) { init(url: URL, delegate: FeedFinderDelegate) {
self.delegate = delegate self.delegate = delegate

View File

@ -8,9 +8,9 @@
import Foundation import Foundation
public struct FeedSpecifier: Hashable { struct FeedSpecifier: Hashable {
public enum Source: Int { enum Source: Int {
case UserEntered = 0, HTMLHead, HTMLLink case UserEntered = 0, HTMLHead, HTMLLink
@ -66,20 +66,6 @@ public struct FeedSpecifier: Hashable {
return currentBestFeed return currentBestFeed
} }
// MARK: - Hashable
public func hash(into hasher: inout Hasher) {
hasher.combine(urlString)
}
// MARK: - Equatable
public static func ==(lhs: FeedSpecifier, rhs: FeedSpecifier) -> Bool {
return lhs.urlString == rhs.urlString && lhs.title == rhs.title && lhs.source == rhs.source
}
} }
private extension FeedSpecifier { private extension FeedSpecifier {