Fix source code warnings.

This commit is contained in:
Maurice Parker 2020-04-21 02:09:59 -05:00
parent 7268dcdd77
commit fc37472757
2 changed files with 2 additions and 4 deletions

View File

@ -172,8 +172,6 @@ private extension CloudKitArticlesZone {
record![CloudKitArticleStatus.Fields.read] = status.flag ? "1" : "0" record![CloudKitArticleStatus.Fields.read] = status.flag ? "1" : "0"
case .starred: case .starred:
record![CloudKitArticleStatus.Fields.starred] = status.flag ? "1" : "0" record![CloudKitArticleStatus.Fields.starred] = status.flag ? "1" : "0"
default:
break
} }
} }

View File

@ -37,7 +37,7 @@ final class NewsBlurAPICaller: NSObject {
func validateCredentials(completion: @escaping (Result<Credentials?, Error>) -> Void) { func validateCredentials(completion: @escaping (Result<Credentials?, Error>) -> Void) {
requestData(endpoint: "api/login", resultType: NewsBlurLoginResponse.self) { result in requestData(endpoint: "api/login", resultType: NewsBlurLoginResponse.self) { result in
switch result { switch result {
case .success(let response, let payload): case .success((let response, let payload)):
guard let url = response.url, let headerFields = response.allHeaderFields as? [String: String], payload?.code != -1 else { guard let url = response.url, let headerFields = response.allHeaderFields as? [String: String], payload?.code != -1 else {
let error = payload?.errors?.username ?? payload?.errors?.others let error = payload?.errors?.username ?? payload?.errors?.others
if let message = error?.first { if let message = error?.first {
@ -227,7 +227,7 @@ final class NewsBlurAPICaller: NSObject {
resultType: NewsBlurAddURLResponse.self resultType: NewsBlurAddURLResponse.self
) { result in ) { result in
switch result { switch result {
case .success(_, let payload): case .success((_, let payload)):
completion(.success(payload?.feed)) completion(.success(payload?.feed))
case .failure(let error): case .failure(let error):
completion(.failure(error)) completion(.failure(error))