Skip to content

Commit

Permalink
Remove #if compiler(>=5.5) (#404)
Browse files Browse the repository at this point in the history
Co-authored-by: Cory Benfield <[email protected]>
  • Loading branch information
dnadoba and Lukasa authored Oct 12, 2022
1 parent 9fcdd00 commit b8a78b0
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 24 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ let client = ClientBootstrap(group: group)
}
```

The most recent versions of SwiftNIO SSL support Swift 5.5 and newer. The minimum Swift version supported by SwiftNIO SSL releases are detailed below:
The most recent versions of SwiftNIO SSL support Swift 5.5.2 and newer. The minimum Swift version supported by SwiftNIO SSL releases are detailed below:

SwiftNIO SSL | Minimum Swift Version
--------------------|----------------------
`2.0.0 ..< 2.14.0` | 5.0
`2.14.0 ..< 2.19.0` | 5.2
`2.19.0 ..< 2.23.0` | 5.4
`2.23.0 ...` | 5.5
`2.23.0 ...` | 5.5.2
4 changes: 2 additions & 2 deletions Sources/NIOSSL/Docs.docc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ let client = ClientBootstrap(group: group)
}
```

The most recent versions of SwiftNIO SSL support Swift 5.5 and newer. The minimum Swift version supported by SwiftNIO SSL releases are detailed below:
The most recent versions of SwiftNIO SSL support Swift 5.5.2 and newer. The minimum Swift version supported by SwiftNIO SSL releases are detailed below:

SwiftNIO SSL | Minimum Swift Version
--------------------|----------------------
`2.0.0 ..< 2.14.0` | 5.0
`2.14.0 ..< 2.19.0` | 5.2
`2.19.0 ..< 2.23.0` | 5.4
`2.23.0 ...` | 5.5
`2.23.0 ...` | 5.5.2

## Topics

Expand Down
2 changes: 0 additions & 2 deletions Sources/NIOSSL/ObjectIdentifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,8 @@ public struct NIOSSLObjectIdentifier {
}
}

#if swift(>=5.5) && canImport(_Concurrency)
// NIOSSLObjectIdentifier is immutable and therefore Sendable
extension NIOSSLObjectIdentifier: @unchecked Sendable {}
#endif

extension NIOSSLObjectIdentifier: Equatable {
public static func == (lhs: NIOSSLObjectIdentifier, rhs: NIOSSLObjectIdentifier) -> Bool {
Expand Down
2 changes: 0 additions & 2 deletions Sources/NIOSSL/SSLCertificate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,9 @@ public final class NIOSSLCertificate {
}
}

#if swift(>=5.5) && canImport(_Concurrency)
// NIOSSLCertificate is publicly immutable and we do not internally mutate it after initialisation.
// It is therefore Sendable.
extension NIOSSLCertificate: @unchecked Sendable {}
#endif

// MARK:- Utility Functions
// We don't really want to get too far down the road of providing helpers for things like certificates
Expand Down
6 changes: 0 additions & 6 deletions Sources/NIOSSL/SSLCertificateExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,8 @@ extension NIOSSLCertificate {
}
}

#if swift(>=5.5) && canImport(_Concurrency)
// NIOSSLCertificate._Extensions is immutable and therefore Sendable
extension NIOSSLCertificate._Extensions: @unchecked Sendable {}
#endif

extension NIOSSLCertificate {
public var _extensions: NIOSSLCertificate._Extensions {
Expand Down Expand Up @@ -170,10 +168,8 @@ extension NIOSSLCertificate {
}
}

#if swift(>=5.5) && canImport(_Concurrency)
// NIOSSLCertificate._Extension is immutable and therefore Sendable
extension NIOSSLCertificate._Extension: @unchecked Sendable {}
#endif

extension NIOSSLCertificate._Extension {
public struct Data {
Expand Down Expand Up @@ -204,10 +200,8 @@ extension NIOSSLCertificate._Extension {
}
}

#if swift(>=5.5) && canImport(_Concurrency)
// NIOSSLCertificate._Extension.Data is immutable and therefore Sendable
extension NIOSSLCertificate._Extension.Data: @unchecked Sendable {}
#endif

extension NIOSSLCertificate._Extension.Data: RandomAccessCollection {
@inlinable public var startIndex: Int { self.buffer.startIndex }
Expand Down
2 changes: 0 additions & 2 deletions Sources/NIOSSL/SSLContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -470,10 +470,8 @@ public final class NIOSSLContext {
}
}

#if swift(>=5.5) && canImport(_Concurrency)
// NIOSSLContext is thread-safe and therefore Sendable
extension NIOSSLContext: @unchecked Sendable {}
#endif


extension NIOSSLContext {
Expand Down
4 changes: 0 additions & 4 deletions Sources/NIOSSL/SubjectAlternativeName.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,8 @@ public struct _SubjectAlternativeNames {
}
}

#if swift(>=5.5) && canImport(_Concurrency)
// _SubjectAlternativeNames is immutable and therefore Sendable
extension _SubjectAlternativeNames: @unchecked Sendable {}
#endif

extension _SubjectAlternativeNames: RandomAccessCollection {

Expand Down Expand Up @@ -132,13 +130,11 @@ public struct _SubjectAlternativeName {
public var contents: Contents
}

#if swift(>=5.5) && canImport(_Concurrency)
// _SubjectAlternativeName is immutable and therefore Sendable
extension _SubjectAlternativeName: @unchecked Sendable {}

// _SubjectAlternativeName.Contents is immutable and therefore Sendable
extension _SubjectAlternativeName.Contents: @unchecked Sendable {}
#endif

extension _SubjectAlternativeName.Contents: RandomAccessCollection {

Expand Down
2 changes: 0 additions & 2 deletions Sources/NIOSSL/SwiftCrypto/NIOSSLSecureBytes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,8 @@ public struct NIOSSLSecureBytes {
}
}

#if swift(>=5.5) && canImport(_Concurrency)
// NIOSSLSecureBytes is a Copy on Write (CoW) type and therefore Sendable
extension NIOSSLSecureBytes: @unchecked Sendable {}
#endif

extension NIOSSLSecureBytes {
/// Append the contents of a collection of bytes to this ``NIOSSLSecureBytes``.
Expand Down
4 changes: 2 additions & 2 deletions Tests/NIOSSLTests/UnsafeTransfer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ final class UnsafeMutableTransferBox<Wrapped> {
self.wrappedValue = wrappedValue
}
}
#if swift(>=5.5) && canImport(_Concurrency)

extension UnsafeMutableTransferBox: @unchecked Sendable {}
#endif

0 comments on commit b8a78b0

Please sign in to comment.