Skip to content

Commit 7e53749

Browse files
authored
Align supported Swift versions with rest of the ecosystem (#141)
# Motivation Most of the server ecosystem follows the supported Swift versions from `swift-nio`. This means supporting the latest 3 Swift releases. # Modification This PR drops support for all Swift versions before 5.8. # Result This makes maintaining this repository easier and allows us to clean up some no longer needed stuff.
1 parent 9c0646a commit 7e53749

26 files changed

+1
-947
lines changed

[email protected]

Lines changed: 0 additions & 43 deletions
This file was deleted.

[email protected]

Lines changed: 0 additions & 43 deletions
This file was deleted.

[email protected]

Lines changed: 0 additions & 43 deletions
This file was deleted.

[email protected]

Lines changed: 0 additions & 43 deletions
This file was deleted.

[email protected]

Lines changed: 0 additions & 43 deletions
This file was deleted.

[email protected]

Lines changed: 0 additions & 43 deletions
This file was deleted.

[email protected]

Lines changed: 0 additions & 43 deletions
This file was deleted.

Sources/CoreMetrics/Metrics.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,7 +1253,6 @@ public final class NOOPMetricsHandler: MetricsFactory, CounterHandler, FloatingP
12531253

12541254
// MARK: - Sendable support helpers
12551255

1256-
#if compiler(>=5.6)
12571256
extension MetricsSystem: Sendable {}
12581257
extension Counter: Sendable {}
12591258
extension FloatingPointCounter: Sendable {}
@@ -1263,10 +1262,5 @@ extension Timer: Sendable {}
12631262
extension Meter: Sendable {}
12641263
// ideally we would not be using @unchecked here, but concurrency-safety checks do not recognize locks
12651264
extension AccumulatingRoundingFloatingPointCounter: @unchecked Sendable {}
1266-
#endif
12671265

1268-
#if compiler(>=5.6)
12691266
@preconcurrency public protocol _SwiftMetricsSendableProtocol: Sendable {}
1270-
#else
1271-
public protocol _SwiftMetricsSendableProtocol {}
1272-
#endif

Sources/Metrics/Metrics.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ extension Timer {
7575
}
7676
}
7777

78-
#if swift(>=5.7)
7978
extension Timer {
8079
/// Convenience for recording a duration based on ``Duration``.
8180
///
@@ -99,4 +98,3 @@ extension Timer {
9998
self.recordNanoseconds(nanoseconds.partialValue)
10099
}
101100
}
102-
#endif

Sources/MetricsTestKit/TestMetrics.swift

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -576,26 +576,16 @@ extension NSLock {
576576

577577
// MARK: - Errors
578578

579-
#if compiler(>=5.6)
580579
public enum TestMetricsError: Error {
581580
case missingMetric(label: String, dimensions: [(String, String)])
582581
case illegalMetricType(metric: Sendable, expected: String)
583582
}
584583

585-
#else
586-
public enum TestMetricsError: Error {
587-
case missingMetric(label: String, dimensions: [(String, String)])
588-
case illegalMetricType(metric: Any, expected: String)
589-
}
590-
#endif
591-
592584
// MARK: - Sendable support
593585

594-
#if compiler(>=5.6)
595586
// ideally we would not be using @unchecked here, but concurrency-safety checks do not recognize locks
596587
extension TestMetrics: @unchecked Sendable {}
597588
extension TestCounter: @unchecked Sendable {}
598589
extension TestMeter: @unchecked Sendable {}
599590
extension TestRecorder: @unchecked Sendable {}
600591
extension TestTimer: @unchecked Sendable {}
601-
#endif

0 commit comments

Comments
 (0)