From b99da5d3fee8ab155f4a7573aa04ae49820daaa0 Mon Sep 17 00:00:00 2001 From: David Nadoba Date: Thu, 21 Jul 2022 19:20:49 +0200 Subject: [PATCH] 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 --- Tests/NIOHTTP1Tests/HTTPTest.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/NIOHTTP1Tests/HTTPTest.swift b/Tests/NIOHTTP1Tests/HTTPTest.swift index eb4435512..d49b94f54 100644 --- a/Tests/NIOHTTP1Tests/HTTPTest.swift +++ b/Tests/NIOHTTP1Tests/HTTPTest.swift @@ -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) }) }