Fix lint issues.
This commit is contained in:
parent
e52d4c28df
commit
361ecd20e3
@ -116,7 +116,7 @@ final class ReaderAPICaller: NSObject {
|
|||||||
|
|
||||||
var authData: [String: String] = [:]
|
var authData: [String: String] = [:]
|
||||||
rawData.split(separator: "\n").forEach({ (line: Substring) in
|
rawData.split(separator: "\n").forEach({ (line: Substring) in
|
||||||
let items = line.split(separator: "=").map{String($0)}
|
let items = line.split(separator: "=").map {String($0)}
|
||||||
if items.count == 2 {
|
if items.count == 2 {
|
||||||
authData[items[0]] = items[1]
|
authData[items[0]] = items[1]
|
||||||
}
|
}
|
||||||
@ -180,7 +180,6 @@ final class ReaderAPICaller: NSObject {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func retrieveTags(completion: @escaping (Result<[ReaderAPITag]?, Error>) -> Void) {
|
func retrieveTags(completion: @escaping (Result<[ReaderAPITag]?, Error>) -> Void) {
|
||||||
guard let baseURL = apiBaseURL else {
|
guard let baseURL = apiBaseURL else {
|
||||||
completion(.failure(CredentialsError.incompleteCredentials))
|
completion(.failure(CredentialsError.incompleteCredentials))
|
||||||
@ -241,14 +240,11 @@ final class ReaderAPICaller: NSObject {
|
|||||||
switch result {
|
switch result {
|
||||||
case .success:
|
case .success:
|
||||||
completion(.success(()))
|
completion(.success(()))
|
||||||
break
|
case .failure(let error):
|
||||||
case .failure(let error):
|
|
||||||
completion(.failure(error))
|
completion(.failure(error))
|
||||||
break
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
case .failure(let error):
|
case .failure(let error):
|
||||||
completion(.failure(error))
|
completion(.failure(error))
|
||||||
}
|
}
|
||||||
@ -280,14 +276,11 @@ final class ReaderAPICaller: NSObject {
|
|||||||
switch result {
|
switch result {
|
||||||
case .success:
|
case .success:
|
||||||
completion(.success(()))
|
completion(.success(()))
|
||||||
break
|
case .failure(let error):
|
||||||
case .failure(let error):
|
|
||||||
completion(.failure(error))
|
completion(.failure(error))
|
||||||
break
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
case .failure(let error):
|
case .failure(let error):
|
||||||
completion(.failure(error))
|
completion(.failure(error))
|
||||||
}
|
}
|
||||||
@ -354,7 +347,6 @@ final class ReaderAPICaller: NSObject {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
self.requestAuthorizationToken(endpoint: baseURL) { (result) in
|
self.requestAuthorizationToken(endpoint: baseURL) { (result) in
|
||||||
switch result {
|
switch result {
|
||||||
case .success(let token):
|
case .success(let token):
|
||||||
@ -426,10 +418,8 @@ final class ReaderAPICaller: NSObject {
|
|||||||
switch result {
|
switch result {
|
||||||
case .success:
|
case .success:
|
||||||
completion(.success(()))
|
completion(.success(()))
|
||||||
break
|
case .failure(let error):
|
||||||
case .failure(let error):
|
|
||||||
completion(.failure(error))
|
completion(.failure(error))
|
||||||
break
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -486,10 +476,8 @@ final class ReaderAPICaller: NSObject {
|
|||||||
switch result {
|
switch result {
|
||||||
case .success:
|
case .success:
|
||||||
completion(.success(()))
|
completion(.success(()))
|
||||||
break
|
case .failure(let error):
|
||||||
case .failure(let error):
|
|
||||||
completion(.failure(error))
|
completion(.failure(error))
|
||||||
break
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -528,7 +516,7 @@ final class ReaderAPICaller: NSObject {
|
|||||||
let idHexString = String(idValue, radix: 16, uppercase: false)
|
let idHexString = String(idValue, radix: 16, uppercase: false)
|
||||||
return "i=tag:google.com,2005:reader/item/\(idHexString)"
|
return "i=tag:google.com,2005:reader/item/\(idHexString)"
|
||||||
}
|
}
|
||||||
}).joined(separator:"&")
|
}).joined(separator: "&")
|
||||||
|
|
||||||
let postData = "T=\(token)&output=json&\(idsToFetch)".data(using: String.Encoding.utf8)
|
let postData = "T=\(token)&output=json&\(idsToFetch)".data(using: String.Encoding.utf8)
|
||||||
|
|
||||||
@ -546,7 +534,6 @@ final class ReaderAPICaller: NSObject {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
case .failure(let error):
|
case .failure(let error):
|
||||||
completion(.failure(error))
|
completion(.failure(error))
|
||||||
}
|
}
|
||||||
@ -722,7 +709,7 @@ private extension ReaderAPICaller {
|
|||||||
let idHexString = String(format: "%.16llx", intValue)
|
let idHexString = String(format: "%.16llx", intValue)
|
||||||
return "i=tag:google.com,2005:reader/item/\(idHexString)"
|
return "i=tag:google.com,2005:reader/item/\(idHexString)"
|
||||||
}
|
}
|
||||||
}).joined(separator:"&")
|
}).joined(separator: "&")
|
||||||
|
|
||||||
let actionIndicator = add ? "a" : "r"
|
let actionIndicator = add ? "a" : "r"
|
||||||
|
|
||||||
@ -737,12 +724,10 @@ private extension ReaderAPICaller {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
case .failure(let error):
|
case .failure(let error):
|
||||||
completion(.failure(error))
|
completion(.failure(error))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user