Skip to content

Commit 8351542

Browse files
authored
chore: Fix swiftlint violations (#673)
1 parent 04c98bf commit 8351542

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

Sources/ClientRuntime/Networking/HashFunction.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public enum HashFunction {
2828
default: return nil
2929
}
3030
}
31-
31+
3232
static func fromList(_ stringArray: [String]) -> [HashFunction] {
3333
var hashFunctions = [HashFunction]()
3434
for string in stringArray {
@@ -39,7 +39,7 @@ public enum HashFunction {
3939

4040
return hashFunctions
4141
}
42-
42+
4343
func toString() -> String {
4444
switch self {
4545
case .crc32: return "crc32"

Sources/ClientRuntime/Networking/Http/Middlewares/ContentMD5Middleware.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public struct ContentMD5Middleware<OperationStackOutput>: Middleware {
1919
Self.Context == H.Context {
2020

2121
// Skip MD5 hash if using checksums
22-
if (input.headers.exists(name: "x-amz-sdk-checksum-algorithm")) {
22+
if input.headers.exists(name: "x-amz-sdk-checksum-algorithm") {
2323
return try await next.handle(context: context, input: input)
2424
}
2525

Sources/ClientRuntime/Networking/Http/Middlewares/FlexibleChecksumsResponseMiddleware.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ public struct FlexibleChecksumsResponseMiddleware<OperationStackOutput>: Middlew
7272
}
7373

7474
func handleNormalPayload(_ data: Data?) throws {
75-
75+
7676
guard let data else {
7777
throw ClientError.dataNotFound("Cannot calculate checksum of empty body!")
7878
}
79-
79+
8080
let calculatedChecksum = try responseChecksum.computeHash(of: data)
81-
81+
8282
let actualChecksum = calculatedChecksum.toBase64String()
83-
83+
8484
if expectedChecksum != actualChecksum {
8585
throw ChecksumMismatchException.message(
8686
"Checksum mismatch. Expected \(expectedChecksum) but was \(actualChecksum)"
@@ -91,7 +91,7 @@ public struct FlexibleChecksumsResponseMiddleware<OperationStackOutput>: Middlew
9191
func handleStreamPayload(_ stream: Stream) throws {
9292
return
9393
}
94-
94+
9595
// Handle body vs handle stream
9696
switch response.httpResponse.body {
9797
case .data(let data):
@@ -101,7 +101,7 @@ public struct FlexibleChecksumsResponseMiddleware<OperationStackOutput>: Middlew
101101
case .noStream:
102102
throw ClientError.dataNotFound("Cannot calculate the checksum of an empty body!")
103103
}
104-
104+
105105
return try await next.handle(context: context, input: input)
106106
}
107107

0 commit comments

Comments
 (0)