Workaround Sendable warning from Swift 5.7 (#2225)

Workaround for https://github.com/apple/swift/issues/59911
```swift
/src/Tests/NIOHTTP1Tests/HTTPTest.swift:148:21: warning: 'buf' mutated after capture by sendable closure
                buf.writeString("\(c)")
```
The variable `buf` is mutated but only before being capture by the sendable closure.

All other warnings/errors are fixed with the latest Swift 5.7 toolchain
This commit is contained in:
David Nadoba authored and GitHub committed 2022-07-21 18:20:49 +01:00
1 parent 48916a49af
commit b99da5d3fe
1 file changed
+1 -1
+1 -1
View File
@@ -146,7 +146,7 @@ class HTTPTest: XCTestCase {
var buf = chan.allocator.buffer(capacity: 1024)
buf.writeString("\(c)")
writeFutures.append(chan.eventLoop.makeSucceededFuture(()).flatMapThrowing {
writeFutures.append(chan.eventLoop.makeSucceededFuture(()).flatMapThrowing { [buf] in
try chan.writeInbound(buf)
})
}