Skip to content

Commit 9eb45cd

Browse files
committed
update Runtime to Swift 5
1 parent f232ca9 commit 9eb45cd

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

Package.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// swift-tools-version:4.2
1+
// swift-tools-version:5.0
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
23

34
import PackageDescription
45

Sources/AWSLambdaSwift/Runtime.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class Runtime {
3030
throw RuntimeError.missingEnvironmentVariables
3131
}
3232

33-
guard let periodIndex = handler.index(of: ".") else {
33+
guard let periodIndex = handler.firstIndex(of: ".") else {
3434
throw RuntimeError.invalidHandlerName
3535
}
3636

Sources/AWSLambdaSwift/Types.swift

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
import Foundation
22

3-
// Remove when moving to swift 5
4-
enum HandlerResult {
5-
case success(Data)
6-
case failure(Error)
7-
}
3+
typealias HandlerResult = Result<Data, Error>
84

95
protocol SyncHandler {
106
func apply(inputData: Data, context: Context) throws -> Data

0 commit comments

Comments
 (0)