Skip to content

Commit

Permalink
use modern handler on linux on swift 6
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronsky committed Sep 21, 2024
1 parent c078e6b commit 84f942f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/AppStoreConnect/Networking/Transport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ extension URLSession: Transport {
public func send(request: URLRequest, decoder: JSONDecoder) async throws -> Response<Data> {
// These depend on swift-corelibs-foundation, which have not implemented the
// Task-based API for URLSession.
#if os(Linux) || os(Windows)
#if (os(Linux) || os(Windows)) && swift(<6.0)
return try await withCheckedThrowingContinuation { continuation in
send(request: request, decoder: decoder, completion: continuation.resume)
}
Expand Down Expand Up @@ -120,7 +120,7 @@ extension URLSession: Transport {
public func download(request: URLRequest) async throws -> Response<URL> {
// These depend on swift-corelibs-foundation, which have not implemented the
// Task-based API for URLSession.
#if os(Linux) || os(Windows)
#if (os(Linux) || os(Windows)) && swift(<6.0)
return try await withCheckedThrowingContinuation { continuation in
download(request: request, completion: continuation.resume)
}
Expand Down Expand Up @@ -191,7 +191,7 @@ extension URLSession: Transport {
public func upload(request: URLRequest, data: Data, decoder: JSONDecoder) async throws -> Response<Data> {
// These depend on swift-corelibs-foundation, which have not implemented the
// Task-based API for URLSession.
#if os(Linux) || os(Windows)
#if (os(Linux) || os(Windows)) && swift(<6.0)
return try await withCheckedThrowingContinuation { continuation in
upload(request: request, data: data, decoder: decoder, completion: continuation.resume)
}
Expand Down

0 comments on commit 84f942f

Please sign in to comment.