Skip to content

Commit b04e845

Browse files
committed
apply swift format
1 parent dce6fa2 commit b04e845

File tree

6 files changed

+27
-14
lines changed

6 files changed

+27
-14
lines changed

Examples/Tutorial/Package.swift

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,26 @@
33

44
import PackageDescription
55

6+
import struct Foundation.URL
7+
68
let package = Package(
79
name: "Palindrome",
8-
platforms: [ .macOS(.v15)],
10+
platforms: [.macOS(.v15)],
911
dependencies: [
10-
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", branch: "main"),
12+
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", branch: "main")
1113
],
1214
targets: [
1315
// Targets are the basic building blocks of a package, defining a module or a test suite.
1416
// Targets can depend on other targets in this package and products from dependencies.
1517
.executableTarget(
1618
name: "Palindrome",
1719
dependencies: [
18-
.product(name: "AWSLambdaRuntime", package: "swift-aws-lambda-runtime"),
19-
]),
20+
.product(name: "AWSLambdaRuntime", package: "swift-aws-lambda-runtime")
21+
]
22+
)
2023
]
2124
)
2225

23-
import struct Foundation.URL
24-
2526
if let localDepsPath = Context.environment["LAMBDA_USE_LOCAL_DEPS"],
2627
localDepsPath != "",
2728
let v = try? URL(fileURLWithPath: localDepsPath).resourceValues(forKeys: [.isDirectoryKey]),

Examples/Tutorial/Sources/main.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,13 @@ func isPalindrome(_ text: String) -> Bool {
2121
// the lambda handler function
2222
let runtime = LambdaRuntime {
2323
(event: Request, context: LambdaContext) -> Response in
24-
24+
2525
let result = isPalindrome(event.text)
26-
return Response(text: event.text, isPalindrome: result, message: "Your text is \(result ? "a" : "not a") palindrome")
26+
return Response(
27+
text: event.text,
28+
isPalindrome: result,
29+
message: "Your text is \(result ? "a" : "not a") palindrome"
30+
)
2731
}
2832

2933
// start the runtime

Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-03-04-main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ struct Response: Encodable {
1616
func isPalindrome(_ text: String) -> Bool {
1717
let cleanedText = text.lowercased().filter { $0.isLetter }
1818
return cleanedText == String(cleanedText.reversed())
19-
}
19+
}

Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-03-05-main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ func isPalindrome(_ text: String) -> Bool {
2121
// the lambda handler function
2222
let runtime = LambdaRuntime {
2323
(event: Request, context: LambdaContext) -> Response in
24-
24+
2525
}

Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-03-06-main.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,12 @@ func isPalindrome(_ text: String) -> Bool {
2121
// the lambda handler function
2222
let runtime = LambdaRuntime {
2323
(event: Request, context: LambdaContext) -> Response in
24-
24+
2525
// call the business function and return a response
2626
let result = isPalindrome(event.text)
27-
return Response(text: event.text, isPalindrome: result, message: "Your text is \(result ? "a" : "not a") palindrome")
27+
return Response(
28+
text: event.text,
29+
isPalindrome: result,
30+
message: "Your text is \(result ? "a" : "not a") palindrome"
31+
)
2832
}

Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-03-07-main.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,14 @@ func isPalindrome(_ text: String) -> Bool {
2121
// the lambda handler function
2222
let runtime = LambdaRuntime {
2323
(event: Request, context: LambdaContext) -> Response in
24-
24+
2525
// call the business function and return a response
2626
let result = isPalindrome(event.text)
27-
return Response(text: event.text, isPalindrome: result, message: "Your text is \(result ? "a" : "not a") palindrome")
27+
return Response(
28+
text: event.text,
29+
isPalindrome: result,
30+
message: "Your text is \(result ? "a" : "not a") palindrome"
31+
)
2832
}
2933

3034
// start the runtime

0 commit comments

Comments
 (0)