Skip to content

Commit

Permalink
Align supported Swift versions with rest of the ecosystem (#141)
Browse files Browse the repository at this point in the history
# 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.
  • Loading branch information
FranzBusch authored May 9, 2024
1 parent 9c0646a commit 7e53749
Show file tree
Hide file tree
Showing 26 changed files with 1 addition and 947 deletions.
43 changes: 0 additions & 43 deletions [email protected]

This file was deleted.

43 changes: 0 additions & 43 deletions [email protected]

This file was deleted.

43 changes: 0 additions & 43 deletions [email protected]

This file was deleted.

43 changes: 0 additions & 43 deletions [email protected]

This file was deleted.

43 changes: 0 additions & 43 deletions [email protected]

This file was deleted.

43 changes: 0 additions & 43 deletions [email protected]

This file was deleted.

43 changes: 0 additions & 43 deletions [email protected]

This file was deleted.

6 changes: 0 additions & 6 deletions Sources/CoreMetrics/Metrics.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1253,7 +1253,6 @@ public final class NOOPMetricsHandler: MetricsFactory, CounterHandler, FloatingP

// MARK: - Sendable support helpers

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

#if compiler(>=5.6)
@preconcurrency public protocol _SwiftMetricsSendableProtocol: Sendable {}
#else
public protocol _SwiftMetricsSendableProtocol {}
#endif
2 changes: 0 additions & 2 deletions Sources/Metrics/Metrics.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ extension Timer {
}
}

#if swift(>=5.7)
extension Timer {
/// Convenience for recording a duration based on ``Duration``.
///
Expand All @@ -99,4 +98,3 @@ extension Timer {
self.recordNanoseconds(nanoseconds.partialValue)
}
}
#endif
10 changes: 0 additions & 10 deletions Sources/MetricsTestKit/TestMetrics.swift
Original file line number Diff line number Diff line change
Expand Up @@ -576,26 +576,16 @@ extension NSLock {

// MARK: - Errors

#if compiler(>=5.6)
public enum TestMetricsError: Error {
case missingMetric(label: String, dimensions: [(String, String)])
case illegalMetricType(metric: Sendable, expected: String)
}

#else
public enum TestMetricsError: Error {
case missingMetric(label: String, dimensions: [(String, String)])
case illegalMetricType(metric: Any, expected: String)
}
#endif

// MARK: - Sendable support

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

0 comments on commit 7e53749

Please sign in to comment.