Use synthesized Hashable, Equatable. Remove some extraneous public declarations.
This commit is contained in:
parent
9f78c3d8a5
commit
63b0dd3cfc
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue