Skip to content

Commit

Permalink
Remove all code that solely existed to support Swift 5.8 (#516)
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianfett authored Oct 9, 2024
1 parent c13a11a commit 225c5c4
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 1,423 deletions.
14 changes: 0 additions & 14 deletions Sources/ConnectionPoolModule/ConnectionPool.swift
Original file line number Diff line number Diff line change
Expand Up @@ -571,20 +571,6 @@ extension PoolConfiguration {
}
}

#if swift(<5.9)
// This should be removed once we support Swift 5.9+ only
extension AsyncStream {
static func makeStream(
of elementType: Element.Type = Element.self,
bufferingPolicy limit: Continuation.BufferingPolicy = .unbounded
) -> (stream: AsyncStream<Element>, continuation: AsyncStream<Element>.Continuation) {
var continuation: AsyncStream<Element>.Continuation!
let stream = AsyncStream<Element>(bufferingPolicy: limit) { continuation = $0 }
return (stream: stream, continuation: continuation!)
}
}
#endif

@usableFromInline
protocol TaskGroupProtocol {
// We need to call this `addTask_` because some Swift versions define this
Expand Down
16 changes: 0 additions & 16 deletions Sources/PostgresNIO/New/NotificationListener.swift
Original file line number Diff line number Diff line change
Expand Up @@ -140,19 +140,3 @@ final class NotificationListener: @unchecked Sendable {
}
}
}


#if compiler(<5.9)
// Async stream API backfill
extension AsyncThrowingStream {
static func makeStream(
of elementType: Element.Type = Element.self,
throwing failureType: Failure.Type = Failure.self,
bufferingPolicy limit: Continuation.BufferingPolicy = .unbounded
) -> (stream: AsyncThrowingStream<Element, Failure>, continuation: AsyncThrowingStream<Element, Failure>.Continuation) where Failure == Error {
var continuation: AsyncThrowingStream<Element, Failure>.Continuation!
let stream = AsyncThrowingStream<Element, Failure>(bufferingPolicy: limit) { continuation = $0 }
return (stream: stream, continuation: continuation!)
}
}
#endif
Loading

0 comments on commit 225c5c4

Please sign in to comment.