Skip to content

Commit b48da18

Browse files
committed
More fixes for Swift 6
1 parent 7b26da5 commit b48da18

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

Sources/AWSLambdaRuntimeCore/Lambda.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public enum Lambda {
6060
}
6161

6262
/// The default EventLoop the Lambda is scheduled on.
63-
public static var defaultEventLoop: any EventLoop = NIOSingletons.posixEventLoopGroup.next()
63+
package static let defaultEventLoop: any EventLoop = NIOSingletons.posixEventLoopGroup.next()
6464
}
6565

6666
// MARK: - Public API

Sources/AWSLambdaRuntimeCore/LambdaHandlers.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ extension LambdaRuntime {
193193
>(
194194
encoder: Encoder,
195195
decoder: Decoder,
196-
body: @escaping (Event, LambdaContext) async throws -> Output
196+
body: sending @escaping (Event, LambdaContext) async throws -> Output
197197
)
198198
where
199199
Handler == LambdaCodableAdapter<
@@ -219,7 +219,7 @@ extension LambdaRuntime {
219219
/// - Parameter decoder: The decoder object that will be used to decode the incoming ``ByteBuffer`` event into the generic ``Event`` type.
220220
public convenience init<Event: Decodable, Decoder: LambdaEventDecoder>(
221221
decoder: Decoder,
222-
body: @escaping (Event, LambdaContext) async throws -> Void
222+
body: sending @escaping (Event, LambdaContext) async throws -> Void
223223
)
224224
where
225225
Handler == LambdaCodableAdapter<

Sources/AWSLambdaRuntimeCore/LambdaRequestID.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,16 @@ struct LambdaRequestID {
8888
}
8989

9090
/// thread safe secure random number generator.
91-
private static var generator = SystemRandomNumberGenerator()
9291
private static func generateRandom() -> Self {
92+
var generator = SystemRandomNumberGenerator()
93+
9394
var _uuid: uuid_t = LambdaRequestID.null
9495
// https://tools.ietf.org/html/rfc4122#page-14
9596
// o Set all the other bits to randomly (or pseudo-randomly) chosen
9697
// values.
9798
withUnsafeMutableBytes(of: &_uuid) { ptr in
98-
ptr.storeBytes(of: Self.generator.next(), toByteOffset: 0, as: UInt64.self)
99-
ptr.storeBytes(of: Self.generator.next(), toByteOffset: 8, as: UInt64.self)
99+
ptr.storeBytes(of: generator.next(), toByteOffset: 0, as: UInt64.self)
100+
ptr.storeBytes(of: generator.next(), toByteOffset: 8, as: UInt64.self)
100101
}
101102

102103
// o Set the four most significant bits (bits 12 through 15) of the

0 commit comments

Comments
 (0)