Skip to content

Commit 5f541d0

Browse files
authored
Drop support for Swift 5.7 (#485)
1 parent e7b9a08 commit 5f541d0

File tree

7 files changed

+9
-26
lines changed

7 files changed

+9
-26
lines changed

.github/workflows/test.yml

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
swift-image:
21-
- swift:5.7-jammy
2221
- swift:5.8-jammy
2322
- swift:5.9-jammy
2423
- swift:5.10-noble

Package.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.7
1+
// swift-tools-version:5.8
22
import PackageDescription
33

44
let package = Package(

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<img src="https://img.shields.io/github/actions/workflow/status/vapor/postgres-nio/test.yml?event=push&style=plastic&logo=github&label=tests&logoColor=%23ccc" alt="Continuous Integration">
1717
</a>
1818
<a href="https://swift.org">
19-
<img src="https://design.vapor.codes/images/swift57up.svg" alt="Swift 5.7+">
19+
<img src="https://design.vapor.codes/images/swift58up.svg" alt="Swift 5.8+">
2020
</a>
2121
<a href="https://www.swift.org/sswg/incubation-process.html">
2222
<img src="https://design.vapor.codes/images/sswg-graduated.svg" alt="SSWG Incubation Level: Graduated">
@@ -167,7 +167,7 @@ Please see [SECURITY.md] for details on the security process.
167167
[Team Chat]: https://discord.gg/vapor
168168
[MIT License]: LICENSE
169169
[Continuous Integration]: https://github.com/vapor/postgres-nio/actions
170-
[Swift 5.7]: https://swift.org
170+
[Swift 5.8]: https://swift.org
171171
[Security.md]: https://github.com/vapor/.github/blob/main/SECURITY.md
172172

173173
[`PostgresConnection`]: https://api.vapor.codes/postgresnio/documentation/postgresnio/postgresconnection

Sources/ConnectionPoolModule/ConnectionPool.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ public final class ConnectionPool<
273273

274274
public func run() async {
275275
await withTaskCancellationHandler {
276-
#if swift(>=5.8) && os(Linux) || swift(>=5.9)
276+
#if os(Linux) || compiler(>=5.9)
277277
if #available(macOS 14.0, iOS 17.0, tvOS 17.0, watchOS 10.0, *) {
278278
return await withDiscardingTaskGroup() { taskGroup in
279279
await self.run(in: &taskGroup)
@@ -313,7 +313,7 @@ public final class ConnectionPool<
313313
case scheduleTimer(StateMachine.Timer)
314314
}
315315

316-
#if swift(>=5.8) && os(Linux) || swift(>=5.9)
316+
#if os(Linux) || compiler(>=5.9)
317317
@available(macOS 14.0, iOS 17.0, tvOS 17.0, watchOS 10.0, *)
318318
private func run(in taskGroup: inout DiscardingTaskGroup) async {
319319
for await event in self.eventStream {
@@ -507,7 +507,7 @@ public final class ConnectionPool<
507507
await withTaskGroup(of: TimerRunResult.self, returning: Void.self) { taskGroup in
508508
taskGroup.addTask {
509509
do {
510-
#if swift(>=5.8) && os(Linux) || swift(>=5.9)
510+
#if os(Linux) || compiler(>=5.9)
511511
try await self.clock.sleep(for: timer.duration)
512512
#else
513513
try await self.clock.sleep(until: self.clock.now.advanced(by: timer.duration), tolerance: nil)
@@ -593,7 +593,7 @@ protocol TaskGroupProtocol {
593593
mutating func addTask_(operation: @escaping @Sendable () async -> Void)
594594
}
595595

596-
#if swift(>=5.8) && os(Linux) || swift(>=5.9)
596+
#if os(Linux) || swift(>=5.9)
597597
@available(macOS 14.0, iOS 17.0, tvOS 17.0, watchOS 10.0, *)
598598
extension DiscardingTaskGroup: TaskGroupProtocol {
599599
@inlinable

Sources/PostgresNIO/New/NotificationListener.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ final class NotificationListener: @unchecked Sendable {
142142
}
143143

144144

145-
#if swift(<5.9)
145+
#if compiler(<5.9)
146146
// Async stream API backfill
147147
extension AsyncThrowingStream {
148148
static func makeStream(

Sources/PostgresNIO/New/PostgresNotificationSequence.swift

+1-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ public struct PostgresNotification: Sendable {
33
public let payload: String
44
}
55

6-
public struct PostgresNotificationSequence: AsyncSequence {
6+
public struct PostgresNotificationSequence: AsyncSequence, Sendable {
77
public typealias Element = PostgresNotification
88

99
let base: AsyncThrowingStream<PostgresNotification, Error>
@@ -20,8 +20,3 @@ public struct PostgresNotificationSequence: AsyncSequence {
2020
}
2121
}
2222
}
23-
24-
#if swift(>=5.7)
25-
// AsyncThrowingStream is marked as Sendable in Swift 5.6
26-
extension PostgresNotificationSequence: Sendable {}
27-
#endif
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,3 @@
1-
#if swift(>=5.8)
2-
31
@_documentation(visibility: internal) @_exported import NIO
42
@_documentation(visibility: internal) @_exported import NIOSSL
53
@_documentation(visibility: internal) @_exported import struct Logging.Logger
6-
7-
#else
8-
9-
// TODO: Remove this with the next major release!
10-
@_exported import NIO
11-
@_exported import NIOSSL
12-
@_exported import struct Logging.Logger
13-
14-
#endif

0 commit comments

Comments
 (0)