Skip to content

Commit 6baa017

Browse files
authored
Fix withTaskCancellationHandler deprecation (#56)
1 parent 80e8a02 commit 6baa017

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/URLRouting/Client/Client.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ extension URLRoutingClient {
9393
let cancel: () -> Void = { dataTask?.cancel() }
9494

9595
return try await withTaskCancellationHandler(
96-
handler: { cancel() },
9796
operation: {
9897
try await withCheckedThrowingContinuation { continuation in
9998
dataTask = session.dataTask(with: request) { data, response, error in
@@ -109,7 +108,8 @@ extension URLRoutingClient {
109108
}
110109
dataTask?.resume()
111110
}
112-
}
111+
},
112+
onCancel: { cancel() }
113113
)
114114
},
115115
decoder: decoder

0 commit comments

Comments
 (0)