summaryrefslogtreecommitdiffhomepage
path: root/ios/MullvadVPN/RelayCache
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2022-03-21 14:33:33 +0100
committerAndrej Mihajlov <and@mullvad.net>2022-03-24 14:00:24 +0100
commit8058f8fc38f0ce34c39bca2d6fc146ac085d5eca (patch)
tree0b6f1e527e56c1675c096dfc11843986bde0f552 /ios/MullvadVPN/RelayCache
parent02c80f6534067e247fffb64e0b448ed1da77fd4d (diff)
downloadmullvadvpn-8058f8fc38f0ce34c39bca2d6fc146ac085d5eca.tar.xz
mullvadvpn-8058f8fc38f0ce34c39bca2d6fc146ac085d5eca.zip
Add conformance of Operation to Cancellable, drop AnyCancellable
Diffstat (limited to 'ios/MullvadVPN/RelayCache')
-rw-r--r--ios/MullvadVPN/RelayCache/RelayCacheTracker.swift8
1 files changed, 3 insertions, 5 deletions
diff --git a/ios/MullvadVPN/RelayCache/RelayCacheTracker.swift b/ios/MullvadVPN/RelayCache/RelayCacheTracker.swift
index c2efd6cb24..b5e9d87a44 100644
--- a/ios/MullvadVPN/RelayCache/RelayCacheTracker.swift
+++ b/ios/MullvadVPN/RelayCache/RelayCacheTracker.swift
@@ -98,7 +98,7 @@ extension RelayCache {
}
}
- func updateRelays(completionHandler: @escaping (OperationCompletion<RelayCache.FetchResult, RelayCache.Error>) -> Void) -> AnyCancellable {
+ func updateRelays(completionHandler: @escaping (OperationCompletion<RelayCache.FetchResult, RelayCache.Error>) -> Void) -> Cancellable {
let operation = UpdateRelaysOperation(
dispatchQueue: stateQueue,
restClient: REST.Client.shared,
@@ -126,9 +126,7 @@ extension RelayCache {
operationQueue.addOperation(operation)
- return AnyCancellable {
- operation.cancel()
- }
+ return operation
}
func read(completionHandler: @escaping (Result<CachedRelays, RelayCache.Error>) -> Void) {
@@ -318,7 +316,7 @@ fileprivate class UpdateRelaysOperation: AsyncOperation {
private let updateHandler: UpdateHandler
private var completionHandler: CompletionHandler?
- private var downloadCancellable: AnyCancellable?
+ private var downloadCancellable: Cancellable?
init(dispatchQueue: DispatchQueue,
restClient: REST.Client,