Skip to content

Commit 5fd3d5c

Browse files
authored
Mark HTTPClientRequest.Prepared as Sendable (#876)
`Transaction` is @unchecked Sendable, since its NIOLockedValueBox can not infer Sendability if its value isn't Sendable. The @unchecked Sendable annotation has hidden the fact, that `HTTPClientRequest.Prepared` needs to be Sendable as well. Let's make this right in this PR.
1 parent 5dd84c7 commit 5fd3d5c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/AsyncHTTPClient/AsyncAwait/HTTPClientRequest+Prepared.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ import struct Foundation.URL
2222

2323
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
2424
extension HTTPClientRequest {
25-
struct Prepared {
26-
enum Body {
25+
struct Prepared: Sendable {
26+
enum Body: Sendable {
2727
case asyncSequence(
2828
length: RequestBodyLength,
2929
makeAsyncIterator: @Sendable () -> ((ByteBufferAllocator) async throws -> ByteBuffer?)
3030
)
3131
case sequence(
3232
length: RequestBodyLength,
3333
canBeConsumedMultipleTimes: Bool,
34-
makeCompleteBody: (ByteBufferAllocator) -> ByteBuffer
34+
makeCompleteBody: @Sendable (ByteBufferAllocator) -> ByteBuffer
3535
)
3636
case byteBuffer(ByteBuffer)
3737
}

0 commit comments

Comments
 (0)