Skip to content

Commit 4198312

Browse files
committed
remove #if swift(>=6.1)
1 parent d5670c3 commit 4198312

33 files changed

+1
-107
lines changed

Sources/AWSLambdaRuntime/ControlPlaneRequest.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,23 @@
1515
import NIOCore
1616
import NIOHTTP1
1717

18-
#if swift(>=6.1)
1918
@available(LambdaSwift 2.0, *)
20-
#endif
2119
enum ControlPlaneRequest: Hashable {
2220
case next
2321
case invocationResponse(String, ByteBuffer?)
2422
case invocationError(String, ErrorResponse)
2523
case initializationError(ErrorResponse)
2624
}
2725

28-
#if swift(>=6.1)
2926
@available(LambdaSwift 2.0, *)
30-
#endif
3127
enum ControlPlaneResponse: Hashable {
3228
case next(InvocationMetadata, ByteBuffer)
3329
case accepted
3430
case error(ErrorResponse)
3531
}
3632

3733
@usableFromInline
38-
#if swift(>=6.1)
3934
@available(LambdaSwift 2.0, *)
40-
#endif
4135
package struct InvocationMetadata: Hashable, Sendable {
4236
@usableFromInline
4337
package let requestID: String

Sources/AWSLambdaRuntime/ControlPlaneRequestEncoder.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414

1515
import NIOCore
1616

17-
#if swift(>=6.1)
1817
@available(LambdaSwift 2.0, *)
19-
#endif
2018
struct ControlPlaneRequestEncoder: _EmittingChannelHandler {
2119
typealias OutboundOut = ByteBuffer
2220

Sources/AWSLambdaRuntime/FoundationSupport/Context+Foundation.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ import FoundationEssentials
1919
import struct Foundation.Date
2020
#endif
2121

22-
#if swift(>=6.1)
2322
@available(LambdaSwift 2.0, *)
24-
#endif
2523
extension LambdaContext {
2624
/// Returns the deadline as a Date for the Lambda function execution.
2725
/// I'm not sure how usefull it is to have this as a Date, with only seconds precision,

Sources/AWSLambdaRuntime/FoundationSupport/Lambda+JSON.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ public struct LambdaJSONOutputEncoder<Output: Encodable>: LambdaOutputEncoder {
5959
}
6060
}
6161

62-
#if swift(>=6.1)
6362
@available(LambdaSwift 2.0, *)
64-
#endif
6563
extension LambdaCodableAdapter {
6664
/// Initializes an instance given an encoder, decoder, and a handler with a non-`Void` output.
6765
/// - Parameters:
@@ -87,9 +85,7 @@ extension LambdaCodableAdapter {
8785
}
8886
}
8987

90-
#if swift(>=6.1)
9188
@available(LambdaSwift 2.0, *)
92-
#endif
9389
extension LambdaRuntime {
9490
/// Initialize an instance with a `LambdaHandler` defined in the form of a closure **with a non-`Void` return type**.
9591
/// - Parameters:

Sources/AWSLambdaRuntime/Lambda+Codable.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ public struct VoidEncoder: LambdaOutputEncoder {
4848
}
4949

5050
/// Adapts a ``LambdaHandler`` conforming handler to conform to ``LambdaWithBackgroundProcessingHandler``.
51-
#if swift(>=6.1)
5251
@available(LambdaSwift 2.0, *)
53-
#endif
5452
public struct LambdaHandlerAdapter<
5553
Event: Decodable,
5654
Output,
@@ -83,9 +81,7 @@ public struct LambdaHandlerAdapter<
8381
}
8482

8583
/// Adapts a ``LambdaWithBackgroundProcessingHandler`` conforming handler to conform to ``StreamingLambdaHandler``.
86-
#if swift(>=6.1)
8784
@available(LambdaSwift 2.0, *)
88-
#endif
8985
public struct LambdaCodableAdapter<
9086
Handler: LambdaWithBackgroundProcessingHandler,
9187
Event: Decodable,

Sources/AWSLambdaRuntime/Lambda+LocalServer.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ import Synchronization
3737
// )
3838
// }
3939
// }
40-
#if swift(>=6.1)
4140
@available(LambdaSwift 2.0, *)
42-
#endif
4341
extension Lambda {
4442
/// Execute code in the context of a mock Lambda server.
4543
///
@@ -87,9 +85,7 @@ extension Lambda {
8785
/// 1. POST /invoke - the client posts the event to the lambda function
8886
///
8987
/// This server passes the data received from /invoke POST request to the lambda function (GET /next) and then forwards the response back to the client.
90-
#if swift(>=6.1)
9188
@available(LambdaSwift 2.0, *)
92-
#endif
9389
internal struct LambdaHTTPServer {
9490
private let invocationEndpoint: String
9591

Sources/AWSLambdaRuntime/Lambda.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ import ucrt
2929
#error("Unsupported platform")
3030
#endif
3131

32-
#if swift(>=6.1)
3332
@available(LambdaSwift 2.0, *)
34-
#endif
3533
public enum Lambda {
3634
@inlinable
3735
package static func runLoop<RuntimeClient: LambdaRuntimeClientProtocol, Handler>(
@@ -101,9 +99,7 @@ public enum Lambda {
10199

102100
// MARK: - Public API
103101

104-
#if swift(>=6.1)
105102
@available(LambdaSwift 2.0, *)
106-
#endif
107103
extension Lambda {
108104
/// Utility to access/read environment variables
109105
public static func env(_ name: String) -> String? {

Sources/AWSLambdaRuntime/LambdaClock.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ import ucrt
5151
/// The Lambda execution environment uses UTC as a timezone,
5252
/// `LambdaClock` operates in UTC and does not account for time zones.
5353
/// see: TZ in https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html
54-
#if swift(>=6.1)
5554
@available(LambdaSwift 2.0, *)
56-
#endif
5755
public struct LambdaClock: Clock {
5856
public typealias Duration = Swift.Duration
5957

Sources/AWSLambdaRuntime/LambdaContext.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,7 @@ public struct ClientContext: Codable, Sendable {
8383

8484
/// Lambda runtime context.
8585
/// The Lambda runtime generates and passes the `LambdaContext` to the Lambda handler as an argument.
86-
#if swift(>=6.1)
8786
@available(LambdaSwift 2.0, *)
88-
#endif
8987
public struct LambdaContext: CustomDebugStringConvertible, Sendable {
9088
final class _Storage: Sendable {
9189
let requestID: String

Sources/AWSLambdaRuntime/LambdaHandlers.swift

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ import NIOCore
2121
/// Background work can also be executed after returning the response. After closing the response stream by calling
2222
/// ``LambdaResponseStreamWriter/finish()`` or ``LambdaResponseStreamWriter/writeAndFinish(_:)``,
2323
/// the ``handle(_:responseWriter:context:)`` function is free to execute any background work.
24-
#if swift(>=6.1)
2524
@available(LambdaSwift 2.0, *)
26-
#endif
2725
public protocol StreamingLambdaHandler: _Lambda_SendableMetatype {
2826
/// The handler function -- implement the business logic of the Lambda function here.
2927
/// - Parameters:
@@ -69,9 +67,7 @@ public protocol LambdaResponseStreamWriter {
6967
///
7068
/// - note: This handler protocol does not support response streaming because the output has to be encoded prior to it being sent, e.g. it is not possible to encode a partial/incomplete JSON string.
7169
/// This protocol also does not support the execution of background work after the response has been returned -- the ``LambdaWithBackgroundProcessingHandler`` protocol caters for such use-cases.
72-
#if swift(>=6.1)
7370
@available(LambdaSwift 2.0, *)
74-
#endif
7571
public protocol LambdaHandler {
7672
/// Generic input type.
7773
/// The body of the request sent to Lambda will be decoded into this type for the handler to consume.
@@ -94,9 +90,7 @@ public protocol LambdaHandler {
9490
/// ``LambdaResponseWriter``that is passed in as an argument, meaning that the
9591
/// ``LambdaWithBackgroundProcessingHandler/handle(_:outputWriter:context:)`` function is then
9692
/// free to implement any background work after the result has been sent to the AWS Lambda control plane.
97-
#if swift(>=6.1)
9893
@available(LambdaSwift 2.0, *)
99-
#endif
10094
public protocol LambdaWithBackgroundProcessingHandler {
10195
/// Generic input type.
10296
/// The body of the request sent to Lambda will be decoded into this type for the handler to consume.
@@ -132,9 +126,7 @@ public protocol LambdaResponseWriter<Output> {
132126

133127
/// A ``StreamingLambdaHandler`` conforming handler object that can be constructed with a closure.
134128
/// Allows for a handler to be defined in a clean manner, leveraging Swift's trailing closure syntax.
135-
#if swift(>=6.1)
136129
@available(LambdaSwift 2.0, *)
137-
#endif
138130
public struct StreamingClosureHandler: StreamingLambdaHandler {
139131
let body: @Sendable (ByteBuffer, LambdaResponseStreamWriter, LambdaContext) async throws -> Void
140132

@@ -163,9 +155,7 @@ public struct StreamingClosureHandler: StreamingLambdaHandler {
163155

164156
/// A ``LambdaHandler`` conforming handler object that can be constructed with a closure.
165157
/// Allows for a handler to be defined in a clean manner, leveraging Swift's trailing closure syntax.
166-
#if swift(>=6.1)
167158
@available(LambdaSwift 2.0, *)
168-
#endif
169159
public struct ClosureHandler<Event: Decodable, Output>: LambdaHandler {
170160
let body: (Event, LambdaContext) async throws -> Output
171161

@@ -190,9 +180,7 @@ public struct ClosureHandler<Event: Decodable, Output>: LambdaHandler {
190180
}
191181
}
192182

193-
#if swift(>=6.1)
194183
@available(LambdaSwift 2.0, *)
195-
#endif
196184
extension LambdaRuntime {
197185
/// Initialize an instance with a ``StreamingLambdaHandler`` in the form of a closure.
198186
/// - Parameter

0 commit comments

Comments
 (0)