Fix lint issues.

This commit is contained in:
Brent Simmons 2025-01-22 22:00:38 -08:00
parent 27500633ab
commit 6fc9e5c25e
47 changed files with 631 additions and 636 deletions

View File

@ -14,7 +14,7 @@ import Secrets
protocol FeedlyAPICallerDelegate: AnyObject { protocol FeedlyAPICallerDelegate: AnyObject {
/// Implemented by the `FeedlyAccountDelegate` reauthorize the client with a fresh OAuth token so the client can retry the unauthorized request. /// Implemented by the `FeedlyAccountDelegate` reauthorize the client with a fresh OAuth token so the client can retry the unauthorized request.
/// Pass `true` to the completion handler if the failing request should be retried with a fresh token or `false` if the unauthorized request should complete with the original failure error. /// Pass `true` to the completion handler if the failing request should be retried with a fresh token or `false` if the unauthorized request should complete with the original failure error.
func reauthorizeFeedlyAPICaller(_ caller: FeedlyAPICaller, completionHandler: @escaping (Bool) -> ()) func reauthorizeFeedlyAPICaller(_ caller: FeedlyAPICaller, completionHandler: @escaping (Bool) -> Void)
} }
final class FeedlyAPICaller { final class FeedlyAPICaller {
@ -26,7 +26,7 @@ final class FeedlyAPICaller {
var baseUrlComponents: URLComponents { var baseUrlComponents: URLComponents {
var components = URLComponents() var components = URLComponents()
components.scheme = "https" components.scheme = "https"
switch self{ switch self {
case .sandbox: case .sandbox:
// https://groups.google.com/forum/#!topic/feedly-cloud/WwQWMgDmOuw // https://groups.google.com/forum/#!topic/feedly-cloud/WwQWMgDmOuw
components.host = "sandbox7.feedly.com" components.host = "sandbox7.feedly.com"
@ -132,7 +132,7 @@ final class FeedlyAPICaller {
} }
} }
func importOpml(_ opmlData: Data, completion: @escaping (Result<Void, Error>) -> ()) { func importOpml(_ opmlData: Data, completion: @escaping (Result<Void, Error>) -> Void) {
guard !isSuspended else { guard !isSuspended else {
return DispatchQueue.main.async { return DispatchQueue.main.async {
completion(.failure(TransportError.suspended)) completion(.failure(TransportError.suspended))
@ -172,7 +172,7 @@ final class FeedlyAPICaller {
} }
} }
func createCollection(named label: String, completion: @escaping (Result<FeedlyCollection, Error>) -> ()) { func createCollection(named label: String, completion: @escaping (Result<FeedlyCollection, Error>) -> Void) {
guard !isSuspended else { guard !isSuspended else {
return DispatchQueue.main.async { return DispatchQueue.main.async {
completion(.failure(TransportError.suspended)) completion(.failure(TransportError.suspended))
@ -224,7 +224,7 @@ final class FeedlyAPICaller {
} }
} }
func renameCollection(with id: String, to name: String, completion: @escaping (Result<FeedlyCollection, Error>) -> ()) { func renameCollection(with id: String, to name: String, completion: @escaping (Result<FeedlyCollection, Error>) -> Void) {
guard !isSuspended else { guard !isSuspended else {
return DispatchQueue.main.async { return DispatchQueue.main.async {
completion(.failure(TransportError.suspended)) completion(.failure(TransportError.suspended))
@ -281,7 +281,7 @@ final class FeedlyAPICaller {
return pathComponent.addingPercentEncoding(withAllowedCharacters: uriComponentAllowed) return pathComponent.addingPercentEncoding(withAllowedCharacters: uriComponentAllowed)
} }
func deleteCollection(with id: String, completion: @escaping (Result<Void, Error>) -> ()) { func deleteCollection(with id: String, completion: @escaping (Result<Void, Error>) -> Void) {
guard !isSuspended else { guard !isSuspended else {
return DispatchQueue.main.async { return DispatchQueue.main.async {
completion(.failure(TransportError.suspended)) completion(.failure(TransportError.suspended))
@ -325,7 +325,7 @@ final class FeedlyAPICaller {
} }
} }
func removeFeed(_ feedId: String, fromCollectionWith collectionId: String, completion: @escaping (Result<Void, Error>) -> ()) { func removeFeed(_ feedId: String, fromCollectionWith collectionId: String, completion: @escaping (Result<Void, Error>) -> Void) {
guard !isSuspended else { guard !isSuspended else {
return DispatchQueue.main.async { return DispatchQueue.main.async {
completion(.failure(TransportError.suspended)) completion(.failure(TransportError.suspended))
@ -389,7 +389,7 @@ final class FeedlyAPICaller {
extension FeedlyAPICaller: FeedlyAddFeedToCollectionService { extension FeedlyAPICaller: FeedlyAddFeedToCollectionService {
func addFeed(with feedId: FeedlyFeedResourceId, title: String? = nil, toCollectionWith collectionId: String, completion: @escaping (Result<[FeedlyFeed], Error>) -> ()) { func addFeed(with feedId: FeedlyFeedResourceId, title: String? = nil, toCollectionWith collectionId: String, completion: @escaping (Result<[FeedlyFeed], Error>) -> Void) {
guard !isSuspended else { guard !isSuspended else {
return DispatchQueue.main.async { return DispatchQueue.main.async {
completion(.failure(TransportError.suspended)) completion(.failure(TransportError.suspended))
@ -470,7 +470,7 @@ extension FeedlyAPICaller: OAuthAuthorizationCodeGrantRequesting {
typealias AccessTokenResponse = FeedlyOAuthAccessTokenResponse typealias AccessTokenResponse = FeedlyOAuthAccessTokenResponse
func requestAccessToken(_ authorizationRequest: OAuthAccessTokenRequest, completion: @escaping (Result<FeedlyOAuthAccessTokenResponse, Error>) -> ()) { func requestAccessToken(_ authorizationRequest: OAuthAccessTokenRequest, completion: @escaping (Result<FeedlyOAuthAccessTokenResponse, Error>) -> Void) {
guard !isSuspended else { guard !isSuspended else {
return DispatchQueue.main.async { return DispatchQueue.main.async {
completion(.failure(TransportError.suspended)) completion(.failure(TransportError.suspended))
@ -517,7 +517,7 @@ extension FeedlyAPICaller: OAuthAuthorizationCodeGrantRequesting {
extension FeedlyAPICaller: OAuthAcessTokenRefreshRequesting { extension FeedlyAPICaller: OAuthAcessTokenRefreshRequesting {
func refreshAccessToken(_ refreshRequest: OAuthRefreshAccessTokenRequest, completion: @escaping (Result<FeedlyOAuthAccessTokenResponse, Error>) -> ()) { func refreshAccessToken(_ refreshRequest: OAuthRefreshAccessTokenRequest, completion: @escaping (Result<FeedlyOAuthAccessTokenResponse, Error>) -> Void) {
guard !isSuspended else { guard !isSuspended else {
return DispatchQueue.main.async { return DispatchQueue.main.async {
completion(.failure(TransportError.suspended)) completion(.failure(TransportError.suspended))
@ -564,7 +564,7 @@ extension FeedlyAPICaller: OAuthAcessTokenRefreshRequesting {
extension FeedlyAPICaller: FeedlyGetCollectionsService { extension FeedlyAPICaller: FeedlyGetCollectionsService {
func getCollections(completion: @escaping (Result<[FeedlyCollection], Error>) -> ()) { func getCollections(completion: @escaping (Result<[FeedlyCollection], Error>) -> Void) {
guard !isSuspended else { guard !isSuspended else {
return DispatchQueue.main.async { return DispatchQueue.main.async {
completion(.failure(TransportError.suspended)) completion(.failure(TransportError.suspended))
@ -605,7 +605,7 @@ extension FeedlyAPICaller: FeedlyGetCollectionsService {
extension FeedlyAPICaller: FeedlyGetStreamContentsService { extension FeedlyAPICaller: FeedlyGetStreamContentsService {
func getStreamContents(for resource: FeedlyResourceId, continuation: String? = nil, newerThan: Date?, unreadOnly: Bool?, completion: @escaping (Result<FeedlyStream, Error>) -> ()) { func getStreamContents(for resource: FeedlyResourceId, continuation: String? = nil, newerThan: Date?, unreadOnly: Bool?, completion: @escaping (Result<FeedlyStream, Error>) -> Void) {
guard !isSuspended else { guard !isSuspended else {
return DispatchQueue.main.async { return DispatchQueue.main.async {
completion(.failure(TransportError.suspended)) completion(.failure(TransportError.suspended))
@ -642,7 +642,7 @@ extension FeedlyAPICaller: FeedlyGetStreamContentsService {
queryItems.append(contentsOf: [ queryItems.append(contentsOf: [
URLQueryItem(name: "count", value: "1000"), URLQueryItem(name: "count", value: "1000"),
URLQueryItem(name: "streamId", value: resource.id), URLQueryItem(name: "streamId", value: resource.id)
]) ])
components.queryItems = queryItems components.queryItems = queryItems
@ -673,7 +673,7 @@ extension FeedlyAPICaller: FeedlyGetStreamContentsService {
extension FeedlyAPICaller: FeedlyGetStreamIdsService { extension FeedlyAPICaller: FeedlyGetStreamIdsService {
func getStreamIds(for resource: FeedlyResourceId, continuation: String? = nil, newerThan: Date?, unreadOnly: Bool?, completion: @escaping (Result<FeedlyStreamIds, Error>) -> ()) { func getStreamIds(for resource: FeedlyResourceId, continuation: String? = nil, newerThan: Date?, unreadOnly: Bool?, completion: @escaping (Result<FeedlyStreamIds, Error>) -> Void) {
guard !isSuspended else { guard !isSuspended else {
return DispatchQueue.main.async { return DispatchQueue.main.async {
completion(.failure(TransportError.suspended)) completion(.failure(TransportError.suspended))
@ -710,7 +710,7 @@ extension FeedlyAPICaller: FeedlyGetStreamIdsService {
queryItems.append(contentsOf: [ queryItems.append(contentsOf: [
URLQueryItem(name: "count", value: "10000"), URLQueryItem(name: "count", value: "10000"),
URLQueryItem(name: "streamId", value: resource.id), URLQueryItem(name: "streamId", value: resource.id)
]) ])
components.queryItems = queryItems components.queryItems = queryItems
@ -741,7 +741,7 @@ extension FeedlyAPICaller: FeedlyGetStreamIdsService {
extension FeedlyAPICaller: FeedlyGetEntriesService { extension FeedlyAPICaller: FeedlyGetEntriesService {
func getEntries(for ids: Set<String>, completion: @escaping (Result<[FeedlyEntry], Error>) -> ()) { func getEntries(for ids: Set<String>, completion: @escaping (Result<[FeedlyEntry], Error>) -> Void) {
guard !isSuspended else { guard !isSuspended else {
return DispatchQueue.main.async { return DispatchQueue.main.async {
completion(.failure(TransportError.suspended)) completion(.failure(TransportError.suspended))
@ -802,7 +802,7 @@ extension FeedlyAPICaller: FeedlyMarkArticlesService {
var entryIds: [String] var entryIds: [String]
} }
func mark(_ articleIds: Set<String>, as action: FeedlyMarkAction, completion: @escaping (Result<Void, Error>) -> ()) { func mark(_ articleIds: Set<String>, as action: FeedlyMarkAction, completion: @escaping (Result<Void, Error>) -> Void) {
guard !isSuspended else { guard !isSuspended else {
return DispatchQueue.main.async { return DispatchQueue.main.async {
completion(.failure(TransportError.suspended)) completion(.failure(TransportError.suspended))
@ -823,7 +823,7 @@ extension FeedlyAPICaller: FeedlyMarkArticlesService {
let articleIdChunks = Array(articleIds).chunked(into: 300) let articleIdChunks = Array(articleIds).chunked(into: 300)
let dispatchGroup = DispatchGroup() let dispatchGroup = DispatchGroup()
var groupError: Error? = nil var groupError: Error?
for articleIdChunk in articleIdChunks { for articleIdChunk in articleIdChunks {
@ -870,7 +870,7 @@ extension FeedlyAPICaller: FeedlyMarkArticlesService {
extension FeedlyAPICaller: FeedlySearchService { extension FeedlyAPICaller: FeedlySearchService {
func getFeeds(for query: String, count: Int, locale: String, completion: @escaping (Result<FeedlyFeedsSearchResponse, Error>) -> ()) { func getFeeds(for query: String, count: Int, locale: String, completion: @escaping (Result<FeedlyFeedsSearchResponse, Error>) -> Void) {
guard !isSuspended else { guard !isSuspended else {
return DispatchQueue.main.async { return DispatchQueue.main.async {
@ -887,7 +887,6 @@ extension FeedlyAPICaller: FeedlySearchService {
URLQueryItem(name: "locale", value: locale) URLQueryItem(name: "locale", value: locale)
] ]
guard let url = components.url else { guard let url = components.url else {
fatalError("\(components) does not produce a valid URL.") fatalError("\(components) does not produce a valid URL.")
} }
@ -914,7 +913,7 @@ extension FeedlyAPICaller: FeedlySearchService {
extension FeedlyAPICaller: FeedlyLogoutService { extension FeedlyAPICaller: FeedlyLogoutService {
func logout(completion: @escaping (Result<Void, Error>) -> ()) { func logout(completion: @escaping (Result<Void, Error>) -> Void) {
guard !isSuspended else { guard !isSuspended else {
return DispatchQueue.main.async { return DispatchQueue.main.async {
completion(.failure(TransportError.suspended)) completion(.failure(TransportError.suspended))

View File

@ -38,7 +38,7 @@ extension FeedlyAccountDelegate: OAuthAuthorizationGranting {
return FeedlyAPICaller.authorizationCodeUrlRequest(for: authorizationRequest, baseUrlComponents: baseURLComponents) return FeedlyAPICaller.authorizationCodeUrlRequest(for: authorizationRequest, baseUrlComponents: baseURLComponents)
} }
static func requestOAuthAccessToken(with response: OAuthAuthorizationResponse, transport: Transport, completion: @escaping (Result<OAuthAuthorizationGrant, Error>) -> ()) { static func requestOAuthAccessToken(with response: OAuthAuthorizationResponse, transport: Transport, completion: @escaping (Result<OAuthAuthorizationGrant, Error>) -> Void) {
let client = environment.oauthAuthorizationClient let client = environment.oauthAuthorizationClient
let request = OAuthAccessTokenRequest(authorizationResponse: response, let request = OAuthAccessTokenRequest(authorizationResponse: response,
scope: oauthAuthorizationGrantScope, scope: oauthAuthorizationGrantScope,
@ -68,7 +68,7 @@ extension FeedlyAccountDelegate: OAuthAuthorizationGranting {
} }
extension FeedlyAccountDelegate: OAuthAccessTokenRefreshing { extension FeedlyAccountDelegate: OAuthAccessTokenRefreshing {
func refreshAccessToken(with refreshToken: String, client: OAuthAuthorizationClient, completion: @escaping (Result<OAuthAuthorizationGrant, Error>) -> ()) { func refreshAccessToken(with refreshToken: String, client: OAuthAuthorizationClient, completion: @escaping (Result<OAuthAuthorizationGrant, Error>) -> Void) {
let request = OAuthRefreshAccessTokenRequest(refreshToken: refreshToken, scope: nil, client: client) let request = OAuthRefreshAccessTokenRequest(refreshToken: refreshToken, scope: nil, client: client)
caller.refreshAccessToken(request) { result in caller.refreshAccessToken(request) { result in

View File

@ -105,7 +105,7 @@ final class FeedlyAccountDelegate: AccountDelegate {
// MARK: Account API // MARK: Account API
func receiveRemoteNotification(for account: Account, userInfo: [AnyHashable : Any], completion: @escaping () -> Void) { func receiveRemoteNotification(for account: Account, userInfo: [AnyHashable: Any], completion: @escaping () -> Void) {
completion() completion()
} }
@ -170,7 +170,7 @@ final class FeedlyAccountDelegate: AccountDelegate {
func sendArticleStatus(for account: Account, completion: @escaping ((Result<Void, Error>) -> Void)) { func sendArticleStatus(for account: Account, completion: @escaping ((Result<Void, Error>) -> Void)) {
// Ensure remote articles have the same status as they do locally. // Ensure remote articles have the same status as they do locally.
let send = FeedlySendArticleStatusesOperation(database: database, service: caller, log: log) let send = FeedlySendArticleStatusesOperation(database: database, service: caller, log: log)
send.completionBlock = { operation in send.completionBlock = { _ in
// TODO: not call with success if operation was canceled? Not sure. // TODO: not call with success if operation was canceled? Not sure.
DispatchQueue.main.async { DispatchQueue.main.async {
completion(.success(())) completion(.success(()))
@ -395,7 +395,6 @@ final class FeedlyAccountDelegate: AccountDelegate {
log: log, log: log,
customFeedName: feed.editedName) customFeedName: feed.editedName)
addExistingFeed.addCompletionHandler = { result in addExistingFeed.addCompletionHandler = { result in
completion(result) completion(result)
} }
@ -570,7 +569,7 @@ final class FeedlyAccountDelegate: AccountDelegate {
extension FeedlyAccountDelegate: FeedlyAPICallerDelegate { extension FeedlyAccountDelegate: FeedlyAPICallerDelegate {
func reauthorizeFeedlyAPICaller(_ caller: FeedlyAPICaller, completionHandler: @escaping (Bool) -> ()) { func reauthorizeFeedlyAPICaller(_ caller: FeedlyAPICaller, completionHandler: @escaping (Bool) -> Void) {
guard let account = initializedAccount else { guard let account = initializedAccount else {
completionHandler(false) completionHandler(false)
return return

View File

@ -36,11 +36,11 @@ public protocol OAuthAcessTokenRefreshRequesting {
/// Access tokens expire. Perform a request for a fresh access token given the long life refresh token received when authorization was granted. /// Access tokens expire. Perform a request for a fresh access token given the long life refresh token received when authorization was granted.
/// - Parameter refreshRequest: The refresh token and other information the authorization server requires to grant the client fresh access tokens on the user's behalf. /// - Parameter refreshRequest: The refresh token and other information the authorization server requires to grant the client fresh access tokens on the user's behalf.
/// - Parameter completion: On success, the access token response appropriate for concrete type's service. Both the access and refresh token should be stored, preferably on the Keychain. On failure, possibly a `URLError` or `OAuthAuthorizationErrorResponse` value. /// - Parameter completion: On success, the access token response appropriate for concrete type's service. Both the access and refresh token should be stored, preferably on the Keychain. On failure, possibly a `URLError` or `OAuthAuthorizationErrorResponse` value.
func refreshAccessToken(_ refreshRequest: OAuthRefreshAccessTokenRequest, completion: @escaping (Result<AccessTokenResponse, Error>) -> ()) func refreshAccessToken(_ refreshRequest: OAuthRefreshAccessTokenRequest, completion: @escaping (Result<AccessTokenResponse, Error>) -> Void)
} }
/// Implemented by concrete types to perform the actual request. /// Implemented by concrete types to perform the actual request.
protocol OAuthAccessTokenRefreshing: AnyObject { protocol OAuthAccessTokenRefreshing: AnyObject {
func refreshAccessToken(with refreshToken: String, client: OAuthAuthorizationClient, completion: @escaping (Result<OAuthAuthorizationGrant, Error>) -> ()) func refreshAccessToken(with refreshToken: String, client: OAuthAuthorizationClient, completion: @escaping (Result<OAuthAuthorizationGrant, Error>) -> Void)
} }

View File

@ -15,7 +15,7 @@ import Secrets
class FeedlyAddExistingFeedOperation: FeedlyOperation, FeedlyOperationDelegate, FeedlyCheckpointOperationDelegate { class FeedlyAddExistingFeedOperation: FeedlyOperation, FeedlyOperationDelegate, FeedlyCheckpointOperationDelegate {
private let operationQueue = MainThreadOperationQueue() private let operationQueue = MainThreadOperationQueue()
var addCompletionHandler: ((Result<Void, Error>) -> ())? var addCompletionHandler: ((Result<Void, Error>) -> Void)?
init(account: Account, credentials: Credentials, resource: FeedlyFeedResourceId, service: FeedlyAddFeedToCollectionService, container: Container, progress: DownloadProgress, log: OSLog, customFeedName: String? = nil) throws { init(account: Account, credentials: Credentials, resource: FeedlyFeedResourceId, service: FeedlyAddFeedToCollectionService, container: Container, progress: DownloadProgress, log: OSLog, customFeedName: String? = nil) throws {

View File

@ -9,7 +9,7 @@
import Foundation import Foundation
protocol FeedlyAddFeedToCollectionService { protocol FeedlyAddFeedToCollectionService {
func addFeed(with feedId: FeedlyFeedResourceId, title: String?, toCollectionWith collectionId: String, completion: @escaping (Result<[FeedlyFeed], Error>) -> ()) func addFeed(with feedId: FeedlyFeedResourceId, title: String?, toCollectionWith collectionId: String, completion: @escaping (Result<[FeedlyFeed], Error>) -> Void)
} }
final class FeedlyAddFeedToCollectionOperation: FeedlyOperation, FeedlyFeedsAndFoldersProviding, FeedlyResourceProviding { final class FeedlyAddFeedToCollectionOperation: FeedlyOperation, FeedlyFeedsAndFoldersProviding, FeedlyResourceProviding {

View File

@ -28,11 +28,10 @@ class FeedlyAddNewFeedOperation: FeedlyOperation, FeedlyOperationDelegate, Feedl
private let getStreamContentsService: FeedlyGetStreamContentsService private let getStreamContentsService: FeedlyGetStreamContentsService
private let log: OSLog private let log: OSLog
private var feedResourceId: FeedlyFeedResourceId? private var feedResourceId: FeedlyFeedResourceId?
var addCompletionHandler: ((Result<Feed, Error>) -> ())? var addCompletionHandler: ((Result<Feed, Error>) -> Void)?
init(account: Account, credentials: Credentials, url: String, feedName: String?, searchService: FeedlySearchService, addToCollectionService: FeedlyAddFeedToCollectionService, syncUnreadIdsService: FeedlyGetStreamIdsService, getStreamContentsService: FeedlyGetStreamContentsService, database: SyncDatabase, container: Container, progress: DownloadProgress, log: OSLog) throws { init(account: Account, credentials: Credentials, url: String, feedName: String?, searchService: FeedlySearchService, addToCollectionService: FeedlyAddFeedToCollectionService, syncUnreadIdsService: FeedlyGetStreamIdsService, getStreamContentsService: FeedlyGetStreamContentsService, database: SyncDatabase, container: Container, progress: DownloadProgress, log: OSLog) throws {
let validator = FeedlyFeedContainerValidator(container: container) let validator = FeedlyFeedContainerValidator(container: container)
(self.folder, self.collectionId) = try validator.getValidContainer() (self.folder, self.collectionId) = try validator.getValidContainer()
@ -139,8 +138,7 @@ class FeedlyAddNewFeedOperation: FeedlyOperation, FeedlyOperationDelegate, Feedl
} }
if let feedResource = feedResourceId, let feed = folder.existingFeed(withFeedID: feedResource.id) { if let feedResource = feedResourceId, let feed = folder.existingFeed(withFeedID: feedResource.id) {
handler(.success(feed)) handler(.success(feed))
} } else {
else {
handler(.failure(AccountError.createErrorNotFound)) handler(.failure(AccountError.createErrorNotFound))
} }
addCompletionHandler = nil addCompletionHandler = nil

View File

@ -71,7 +71,7 @@ class FeedlyDownloadArticlesOperation: FeedlyOperation {
override func didCancel() { override func didCancel() {
// TODO: fix error on below line: "Expression type '()' is ambiguous without more context" // TODO: fix error on below line: "Expression type '()' is ambiguous without more context"
//os_log(.debug, log: log, "Cancelling %{public}@.", self) // os_log(.debug, log: log, "Cancelling %{public}@.", self)
operationQueue.cancelAllOperations() operationQueue.cancelAllOperations()
super.didCancel() super.didCancel()
} }

View File

@ -10,7 +10,7 @@ import Foundation
import os.log import os.log
protocol FeedlyLogoutService { protocol FeedlyLogoutService {
func logout(completion: @escaping (Result<Void, Error>) -> ()) func logout(completion: @escaping (Result<Void, Error>) -> Void)
} }
final class FeedlyLogoutOperation: FeedlyOperation { final class FeedlyLogoutOperation: FeedlyOperation {

View File

@ -26,7 +26,7 @@ final class FeedlyOrganiseParsedItemsByFeedOperation: FeedlyOperation, FeedlyPar
return name ?? String(describing: Self.self) return name ?? String(describing: Self.self)
} }
var parsedItemsKeyedByFeedId: [String : Set<ParsedItem>] { var parsedItemsKeyedByFeedId: [String: Set<ParsedItem>] {
precondition(Thread.isMainThread) // Needs to be on main thread because Feed is a main-thread-only model type. precondition(Thread.isMainThread) // Needs to be on main thread because Feed is a main-thread-only model type.
return itemsKeyedByFeedId return itemsKeyedByFeedId
} }

View File

@ -9,7 +9,7 @@
import Foundation import Foundation
protocol FeedlySearchService: AnyObject { protocol FeedlySearchService: AnyObject {
func getFeeds(for query: String, count: Int, locale: String, completion: @escaping (Result<FeedlyFeedsSearchResponse, Error>) -> ()) func getFeeds(for query: String, count: Int, locale: String, completion: @escaping (Result<FeedlyFeedsSearchResponse, Error>) -> Void)
} }
protocol FeedlySearchOperationDelegate: AnyObject { protocol FeedlySearchOperationDelegate: AnyObject {

View File

@ -20,7 +20,7 @@ final class FeedlySyncAllOperation: FeedlyOperation {
private let log: OSLog private let log: OSLog
let syncUUID: UUID let syncUUID: UUID
var syncCompletionHandler: ((Result<Void, Error>) -> ())? var syncCompletionHandler: ((Result<Void, Error>) -> Void)?
/// These requests to Feedly determine which articles to download: /// These requests to Feedly determine which articles to download:
/// 1. The set of all article ids we might need or show. /// 1. The set of all article ids we might need or show.

View File

@ -70,7 +70,6 @@ final class FeedlySyncStreamContentsOperation: FeedlyOperation, FeedlyOperationD
newerThan: newerThan, newerThan: newerThan,
log: log) log: log)
let organiseByFeed = FeedlyOrganiseParsedItemsByFeedOperation(account: account, parsedItemProvider: getPage, log: log) let organiseByFeed = FeedlyOrganiseParsedItemsByFeedOperation(account: account, parsedItemProvider: getPage, log: log)
let updateAccount = FeedlyUpdateAccountFeedsWithItemsOperation(account: account, organisedItemsProvider: organiseByFeed, log: log) let updateAccount = FeedlyUpdateAccountFeedsWithItemsOperation(account: account, organisedItemsProvider: organiseByFeed, log: log)

View File

@ -9,5 +9,5 @@
import Foundation import Foundation
protocol FeedlyGetCollectionsService: AnyObject { protocol FeedlyGetCollectionsService: AnyObject {
func getCollections(completion: @escaping (Result<[FeedlyCollection], Error>) -> ()) func getCollections(completion: @escaping (Result<[FeedlyCollection], Error>) -> Void)
} }

View File

@ -9,5 +9,5 @@
import Foundation import Foundation
protocol FeedlyGetEntriesService: AnyObject { protocol FeedlyGetEntriesService: AnyObject {
func getEntries(for ids: Set<String>, completion: @escaping (Result<[FeedlyEntry], Error>) -> ()) func getEntries(for ids: Set<String>, completion: @escaping (Result<[FeedlyEntry], Error>) -> Void)
} }

View File

@ -9,5 +9,5 @@
import Foundation import Foundation
protocol FeedlyGetStreamContentsService: AnyObject { protocol FeedlyGetStreamContentsService: AnyObject {
func getStreamContents(for resource: FeedlyResourceId, continuation: String?, newerThan: Date?, unreadOnly: Bool?, completion: @escaping (Result<FeedlyStream, Error>) -> ()) func getStreamContents(for resource: FeedlyResourceId, continuation: String?, newerThan: Date?, unreadOnly: Bool?, completion: @escaping (Result<FeedlyStream, Error>) -> Void)
} }

View File

@ -9,5 +9,5 @@
import Foundation import Foundation
protocol FeedlyGetStreamIdsService: AnyObject { protocol FeedlyGetStreamIdsService: AnyObject {
func getStreamIds(for resource: FeedlyResourceId, continuation: String?, newerThan: Date?, unreadOnly: Bool?, completion: @escaping (Result<FeedlyStreamIds, Error>) -> ()) func getStreamIds(for resource: FeedlyResourceId, continuation: String?, newerThan: Date?, unreadOnly: Bool?, completion: @escaping (Result<FeedlyStreamIds, Error>) -> Void)
} }

View File

@ -31,5 +31,5 @@ enum FeedlyMarkAction: String {
} }
protocol FeedlyMarkArticlesService: AnyObject { protocol FeedlyMarkArticlesService: AnyObject {
func mark(_ articleIds: Set<String>, as action: FeedlyMarkAction, completion: @escaping (Result<Void, Error>) -> ()) func mark(_ articleIds: Set<String>, as action: FeedlyMarkAction, completion: @escaping (Result<Void, Error>) -> Void)
} }