Skip to content

Commit 3214185

Browse files
authored
Minor cleanup (#559)
* Remove unnecessary Foundation imports * Remove unnecessary Sendable requirement on JSONEncoder * Remove logging middleware from performance test
1 parent 380075a commit 3214185

File tree

5 files changed

+0
-17
lines changed

5 files changed

+0
-17
lines changed

Sources/Hummingbird/Codable/JSON/JSONCoding.swift

-11
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,3 @@ extension JSONDecoder: RequestDecoder {
4848
return try self.decode(T.self, from: buffer)
4949
}
5050
}
51-
52-
/// `RequestDecoder` and `ResponseEncoder` both require conformance to `Sendable`. Given
53-
/// `JSONEncoder`` and `JSONDecoder`` conform to Sendable in macOS 13+ I think I can just
54-
/// back date the conformance to all versions of Swift, macOS we support
55-
#if hasFeature(RetroactiveAttribute)
56-
extension JSONEncoder: @retroactive @unchecked Sendable {}
57-
extension JSONDecoder: @retroactive @unchecked Sendable {}
58-
#else
59-
extension JSONEncoder: @unchecked Sendable {}
60-
extension JSONDecoder: @unchecked Sendable {}
61-
#endif

Sources/Hummingbird/Error/HTTPError.swift

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
import Foundation
1615
import HTTPTypes
1716
import NIOCore
1817
import NIOFoundationCompat

Sources/Hummingbird/Files/FileProvider.swift

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
import Foundation
1615
import NIOPosix
1716

1817
/// Protocol for file provider type used by ``FileMiddleware``

Sources/HummingbirdTesting/TestClient+types.swift

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
import Foundation
1615
import HTTPTypes
1716
import NIOCore
1817

Sources/PerformanceTest/main.swift

-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ let port = env.get("SERVER_PORT", as: Int.self) ?? 8080
2525
// create app
2626
let elg = MultiThreadedEventLoopGroup(numberOfThreads: 4)
2727
var router = Router()
28-
router.addMiddleware {
29-
LogRequestsMiddleware(.info)
30-
}
3128

3229
// number of raw requests
3330
// ./wrk -c 128 -d 15s -t 8 http://localhost:8080

0 commit comments

Comments
 (0)