From 0918fc17ad79d78e7cef310cdf6884458d091580 Mon Sep 17 00:00:00 2001 From: Rick Newton-Rogers Date: Wed, 1 Oct 2025 13:51:09 +0100 Subject: [PATCH 1/8] Drop Swift 5.10 Motivation: Swift 5.10 is no longer supported, we should bump the tools version and remove it from our CI. Modifications: * Bump the Swift tools version to Swift 6.0 * Remove Swift 5.10 jobs where appropriate in main.yml, pull_request.yml Result: Code reflects our support window. --- .github/workflows/main.yml | 1 - .github/workflows/pull_request.yml | 1 - Package.swift | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 626f178..bb3d211 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,6 @@ jobs: # Disable strict concurrency checking as it intersects badly with # warnings-as-errors on 5.10 and later as SwiftPMs generated test manifest # has a non-sendable global property. - linux_5_10_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error" # TODO: Enable warnings-as-errors on 6.0. linux_6_0_arguments_override: "-Xswiftc -strict-concurrency=complete --explicit-target-dependency-import-check error" linux_6_1_arguments_override: "-Xswiftc -strict-concurrency=complete --explicit-target-dependency-import-check error" diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 1eb9cf9..6469f09 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -18,7 +18,6 @@ jobs: # Disable strict concurrency checking as it intersects badly with # warnings-as-errors on 5.10 and later as SwiftPMs generated test manifest # has a non-sendable global property. - linux_5_10_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error" # TODO: Enable warnings-as-errors on 6.0. linux_6_0_arguments_override: "-Xswiftc -strict-concurrency=complete --explicit-target-dependency-import-check error" linux_6_1_arguments_override: "-Xswiftc -strict-concurrency=complete --explicit-target-dependency-import-check error" diff --git a/Package.swift b/Package.swift index e89aba6..eb6c9b3 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.10 +// swift-tools-version:6.0 //===----------------------------------------------------------------------===// // // This source file is part of the SwiftOpenAPIGenerator open source project From 73620345260d1293b40d7c2d4af0a506065710cd Mon Sep 17 00:00:00 2001 From: Si Beaumont Date: Tue, 7 Oct 2025 15:04:12 +0100 Subject: [PATCH 2/8] remove swift-format-ignore-file from Lock.swift --- Sources/OpenAPIURLSession/BufferedStream/Lock.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/Sources/OpenAPIURLSession/BufferedStream/Lock.swift b/Sources/OpenAPIURLSession/BufferedStream/Lock.swift index b114d46..3a61ef7 100644 --- a/Sources/OpenAPIURLSession/BufferedStream/Lock.swift +++ b/Sources/OpenAPIURLSession/BufferedStream/Lock.swift @@ -11,7 +11,6 @@ // SPDX-License-Identifier: Apache-2.0 // //===----------------------------------------------------------------------===// -// swift-format-ignore-file //===----------------------------------------------------------------------===// // // This source file is part of the SwiftNIO open source project From a6a00f8240b7e04151d634e12ab42d391aaa0446 Mon Sep 17 00:00:00 2001 From: Si Beaumont Date: Tue, 7 Oct 2025 15:06:01 +0100 Subject: [PATCH 3/8] format Lock.swift with swift-nio .swift-format settings --- .../BufferedStream/Lock.swift | 314 +++++++++--------- 1 file changed, 157 insertions(+), 157 deletions(-) diff --git a/Sources/OpenAPIURLSession/BufferedStream/Lock.swift b/Sources/OpenAPIURLSession/BufferedStream/Lock.swift index 3a61ef7..5cf76f6 100644 --- a/Sources/OpenAPIURLSession/BufferedStream/Lock.swift +++ b/Sources/OpenAPIURLSession/BufferedStream/Lock.swift @@ -47,56 +47,56 @@ typealias LockPrimitive = pthread_mutex_t enum LockOperations {} extension LockOperations { - @inlinable - static func create(_ mutex: UnsafeMutablePointer) { - mutex.assertValidAlignment() - - #if os(Windows) - InitializeSRWLock(mutex) - #else - var attr = pthread_mutexattr_t() - pthread_mutexattr_init(&attr) - - let err = pthread_mutex_init(mutex, &attr) - precondition(err == 0, "\(#function) failed in pthread_mutex with error \(err)") - #endif - } - - @inlinable - static func destroy(_ mutex: UnsafeMutablePointer) { - mutex.assertValidAlignment() - - #if os(Windows) - // SRWLOCK does not need to be freed - #else - let err = pthread_mutex_destroy(mutex) - precondition(err == 0, "\(#function) failed in pthread_mutex with error \(err)") - #endif - } - - @inlinable - static func lock(_ mutex: UnsafeMutablePointer) { - mutex.assertValidAlignment() - - #if os(Windows) - AcquireSRWLockExclusive(mutex) - #else - let err = pthread_mutex_lock(mutex) - precondition(err == 0, "\(#function) failed in pthread_mutex with error \(err)") - #endif - } - - @inlinable - static func unlock(_ mutex: UnsafeMutablePointer) { - mutex.assertValidAlignment() - - #if os(Windows) - ReleaseSRWLockExclusive(mutex) - #else - let err = pthread_mutex_unlock(mutex) - precondition(err == 0, "\(#function) failed in pthread_mutex with error \(err)") - #endif - } + @inlinable + static func create(_ mutex: UnsafeMutablePointer) { + mutex.assertValidAlignment() + + #if os(Windows) + InitializeSRWLock(mutex) + #else + var attr = pthread_mutexattr_t() + pthread_mutexattr_init(&attr) + + let err = pthread_mutex_init(mutex, &attr) + precondition(err == 0, "\(#function) failed in pthread_mutex with error \(err)") + #endif + } + + @inlinable + static func destroy(_ mutex: UnsafeMutablePointer) { + mutex.assertValidAlignment() + + #if os(Windows) + // SRWLOCK does not need to be freed + #else + let err = pthread_mutex_destroy(mutex) + precondition(err == 0, "\(#function) failed in pthread_mutex with error \(err)") + #endif + } + + @inlinable + static func lock(_ mutex: UnsafeMutablePointer) { + mutex.assertValidAlignment() + + #if os(Windows) + AcquireSRWLockExclusive(mutex) + #else + let err = pthread_mutex_lock(mutex) + precondition(err == 0, "\(#function) failed in pthread_mutex with error \(err)") + #endif + } + + @inlinable + static func unlock(_ mutex: UnsafeMutablePointer) { + mutex.assertValidAlignment() + + #if os(Windows) + ReleaseSRWLockExclusive(mutex) + #else + let err = pthread_mutex_unlock(mutex) + precondition(err == 0, "\(#function) failed in pthread_mutex with error \(err)") + #endif + } } // Tail allocate both the mutex and a generic value using ManagedBuffer. @@ -130,59 +130,59 @@ extension LockOperations { @usableFromInline final class LockStorage: ManagedBuffer { - @inlinable - static func create(value: Value) -> Self { - let buffer = Self.create(minimumCapacity: 1) { _ in - return value - } - // Avoid 'unsafeDowncast' as there is a miscompilation on 5.10. - let storage = buffer as! Self + @inlinable + static func create(value: Value) -> Self { + let buffer = Self.create(minimumCapacity: 1) { _ in + value + } + // Avoid 'unsafeDowncast' as there is a miscompilation on 5.10. + let storage = buffer as! Self - storage.withUnsafeMutablePointers { _, lockPtr in - LockOperations.create(lockPtr) - } + storage.withUnsafeMutablePointers { _, lockPtr in + LockOperations.create(lockPtr) + } - return storage - } + return storage + } - @inlinable - func lock() { - self.withUnsafeMutablePointerToElements { lockPtr in - LockOperations.lock(lockPtr) + @inlinable + func lock() { + self.withUnsafeMutablePointerToElements { lockPtr in + LockOperations.lock(lockPtr) + } } - } - @inlinable - func unlock() { - self.withUnsafeMutablePointerToElements { lockPtr in - LockOperations.unlock(lockPtr) + @inlinable + func unlock() { + self.withUnsafeMutablePointerToElements { lockPtr in + LockOperations.unlock(lockPtr) + } } - } - @usableFromInline - deinit { - self.withUnsafeMutablePointerToElements { lockPtr in - LockOperations.destroy(lockPtr) + @usableFromInline + deinit { + self.withUnsafeMutablePointerToElements { lockPtr in + LockOperations.destroy(lockPtr) + } } - } - - @inlinable - func withLockPrimitive( - _ body: (UnsafeMutablePointer) throws -> T - ) rethrows -> T { - try self.withUnsafeMutablePointerToElements { lockPtr in - return try body(lockPtr) + + @inlinable + func withLockPrimitive( + _ body: (UnsafeMutablePointer) throws -> T + ) rethrows -> T { + try self.withUnsafeMutablePointerToElements { lockPtr in + try body(lockPtr) + } } - } - - @inlinable - func withLockedValue(_ mutate: (inout Value) throws -> T) rethrows -> T { - try self.withUnsafeMutablePointers { valuePtr, lockPtr in - LockOperations.lock(lockPtr) - defer { LockOperations.unlock(lockPtr) } - return try mutate(&valuePtr.pointee) + + @inlinable + func withLockedValue(_ mutate: (inout Value) throws -> T) rethrows -> T { + try self.withUnsafeMutablePointers { valuePtr, lockPtr in + LockOperations.lock(lockPtr) + defer { LockOperations.unlock(lockPtr) } + return try mutate(&valuePtr.pointee) + } } - } } extension LockStorage: @unchecked Sendable {} @@ -197,83 +197,83 @@ extension LockStorage: @unchecked Sendable {} /// `SRWLOCK` type. @usableFromInline struct Lock { - @usableFromInline - internal let _storage: LockStorage - - /// Create a new lock. - @usableFromInline - init() { - self._storage = .create(value: ()) - } - - /// Acquire the lock. - /// - /// Whenever possible, consider using `withLock` instead of this method and - /// `unlock`, to simplify lock handling. - @inlinable - func lock() { - self._storage.lock() - } - - /// Release the lock. - /// - /// Whenever possible, consider using `withLock` instead of this method and - /// `lock`, to simplify lock handling. - @inlinable - func unlock() { - self._storage.unlock() - } - - @inlinable - internal func withLockPrimitive( - _ body: (UnsafeMutablePointer) throws -> T - ) rethrows -> T { - return try self._storage.withLockPrimitive(body) - } + @usableFromInline + internal let _storage: LockStorage + + /// Create a new lock. + @usableFromInline + init() { + self._storage = .create(value: ()) + } + + /// Acquire the lock. + /// + /// Whenever possible, consider using `withLock` instead of this method and + /// `unlock`, to simplify lock handling. + @inlinable + func lock() { + self._storage.lock() + } + + /// Release the lock. + /// + /// Whenever possible, consider using `withLock` instead of this method and + /// `lock`, to simplify lock handling. + @inlinable + func unlock() { + self._storage.unlock() + } + + @inlinable + internal func withLockPrimitive( + _ body: (UnsafeMutablePointer) throws -> T + ) rethrows -> T { + try self._storage.withLockPrimitive(body) + } } extension Lock { - /// Acquire the lock for the duration of the given block. - /// - /// This convenience method should be preferred to `lock` and `unlock` in - /// most situations, as it ensures that the lock will be released regardless - /// of how `body` exits. - /// - /// - Parameter body: The block to execute while holding the lock. - /// - Returns: The value returned by the block. - @inlinable - func withLock(_ body: () throws -> T) rethrows -> T { - self.lock() - defer { - self.unlock() + /// Acquire the lock for the duration of the given block. + /// + /// This convenience method should be preferred to `lock` and `unlock` in + /// most situations, as it ensures that the lock will be released regardless + /// of how `body` exits. + /// + /// - Parameter body: The block to execute while holding the lock. + /// - Returns: The value returned by the block. + @inlinable + func withLock(_ body: () throws -> T) rethrows -> T { + self.lock() + defer { + self.unlock() + } + return try body() } - return try body() - } } extension Lock: Sendable {} extension UnsafeMutablePointer { - @inlinable - func assertValidAlignment() { - assert(UInt(bitPattern: self) % UInt(MemoryLayout.alignment) == 0) - } + @inlinable + func assertValidAlignment() { + assert(UInt(bitPattern: self) % UInt(MemoryLayout.alignment) == 0) + } } @usableFromInline struct LockedValueBox { - @usableFromInline - let storage: LockStorage - - @usableFromInline - init(_ value: Value) { - self.storage = .create(value: value) - } - - @inlinable - func withLockedValue(_ mutate: (inout Value) throws -> T) rethrows -> T { - return try self.storage.withLockedValue(mutate) - } + @usableFromInline + let storage: LockStorage + + @usableFromInline + init(_ value: Value) { + self.storage = .create(value: value) + } + + @inlinable + func withLockedValue(_ mutate: (inout Value) throws -> T) rethrows -> T { + try self.storage.withLockedValue(mutate) + } } extension LockedValueBox: Sendable where Value: Sendable {} From 7b6199907030682186aca7198d3d6147c2cced76 Mon Sep 17 00:00:00 2001 From: Si Beaumont Date: Tue, 7 Oct 2025 15:28:45 +0100 Subject: [PATCH 4/8] Pull in updated Lock impl from NIO --- .../BufferedStream/Lock.swift | 140 ++++++++++++++---- 1 file changed, 113 insertions(+), 27 deletions(-) diff --git a/Sources/OpenAPIURLSession/BufferedStream/Lock.swift b/Sources/OpenAPIURLSession/BufferedStream/Lock.swift index 5cf76f6..aa4ac1a 100644 --- a/Sources/OpenAPIURLSession/BufferedStream/Lock.swift +++ b/Sources/OpenAPIURLSession/BufferedStream/Lock.swift @@ -27,12 +27,22 @@ #if canImport(Darwin) import Darwin -#elseif canImport(Android) -import Android -#elseif canImport(Glibc) -import Glibc #elseif os(Windows) +import ucrt import WinSDK +#elseif canImport(Glibc) +@preconcurrency import Glibc +#elseif canImport(Musl) +@preconcurrency import Musl +#elseif canImport(Bionic) +@preconcurrency import Bionic +#elseif canImport(WASILibc) +@preconcurrency import WASILibc +#if canImport(wasi_pthread) +import wasi_pthread +#endif +#else +#error("The concurrency Lock module was unable to identify your C library.") #endif #if os(Windows) @@ -43,8 +53,19 @@ typealias LockPrimitive = SRWLOCK typealias LockPrimitive = pthread_mutex_t #endif + +/// A utility function that runs the body code only in debug builds, without +/// emitting compiler warnings. +/// +/// This is currently the only way to do this in Swift: see +/// https://forums.swift.org/t/support-debug-only-code/11037 for a discussion. +@inlinable +internal func debugOnly(_ body: () -> Void) { + assert({ body(); return true }()) +} + @usableFromInline -enum LockOperations {} +enum LockOperations: Sendable {} extension LockOperations { @inlinable @@ -53,9 +74,12 @@ extension LockOperations { #if os(Windows) InitializeSRWLock(mutex) - #else + #elseif (compiler(<6.1) && !os(WASI)) || (compiler(>=6.1) && _runtime(_multithreaded)) var attr = pthread_mutexattr_t() pthread_mutexattr_init(&attr) + debugOnly { + pthread_mutexattr_settype(&attr, .init(PTHREAD_MUTEX_ERRORCHECK)) + } let err = pthread_mutex_init(mutex, &attr) precondition(err == 0, "\(#function) failed in pthread_mutex with error \(err)") @@ -67,8 +91,8 @@ extension LockOperations { mutex.assertValidAlignment() #if os(Windows) - // SRWLOCK does not need to be freed - #else + // SRWLOCK does not need to be free'd + #elseif (compiler(<6.1) && !os(WASI)) || (compiler(>=6.1) && _runtime(_multithreaded)) let err = pthread_mutex_destroy(mutex) precondition(err == 0, "\(#function) failed in pthread_mutex with error \(err)") #endif @@ -80,7 +104,7 @@ extension LockOperations { #if os(Windows) AcquireSRWLockExclusive(mutex) - #else + #elseif (compiler(<6.1) && !os(WASI)) || (compiler(>=6.1) && _runtime(_multithreaded)) let err = pthread_mutex_lock(mutex) precondition(err == 0, "\(#function) failed in pthread_mutex with error \(err)") #endif @@ -92,7 +116,7 @@ extension LockOperations { #if os(Windows) ReleaseSRWLockExclusive(mutex) - #else + #elseif (compiler(<6.1) && !os(WASI)) || (compiler(>=6.1) && _runtime(_multithreaded)) let err = pthread_mutex_unlock(mutex) precondition(err == 0, "\(#function) failed in pthread_mutex with error \(err)") #endif @@ -135,7 +159,9 @@ final class LockStorage: ManagedBuffer { let buffer = Self.create(minimumCapacity: 1) { _ in value } - // Avoid 'unsafeDowncast' as there is a miscompilation on 5.10. + // Intentionally using a force cast here to avoid a miss compiliation in 5.10. + // This is as fast as an unsafeDownCast since ManagedBuffer is inlined and the optimizer + // can eliminate the upcast/downcast pair let storage = buffer as! Self storage.withUnsafeMutablePointers { _, lockPtr in @@ -159,7 +185,7 @@ final class LockStorage: ManagedBuffer { } } - @usableFromInline + @inlinable deinit { self.withUnsafeMutablePointerToElements { lockPtr in LockOperations.destroy(lockPtr) @@ -167,9 +193,7 @@ final class LockStorage: ManagedBuffer { } @inlinable - func withLockPrimitive( - _ body: (UnsafeMutablePointer) throws -> T - ) rethrows -> T { + func withLockPrimitive(_ body: (UnsafeMutablePointer) throws -> T) rethrows -> T { try self.withUnsafeMutablePointerToElements { lockPtr in try body(lockPtr) } @@ -185,11 +209,16 @@ final class LockStorage: ManagedBuffer { } } -extension LockStorage: @unchecked Sendable {} +// This compiler guard is here becaue `ManagedBuffer` is already declaring +// Sendable unavailability after 6.1, which `LockStorage` inherits. +#if compiler(<6.2) +@available(*, unavailable) +extension LockStorage: Sendable {} +#endif /// A threading lock based on `libpthread` instead of `libdispatch`. /// -/// - note: ``Lock`` has reference semantics. +/// - Note: ``Lock`` has reference semantics. /// /// This object provides a lock on top of a single `pthread_mutex_t`. This kind /// of lock is safe to use with `libpthread`-based threading models, such as the @@ -201,7 +230,7 @@ struct Lock { internal let _storage: LockStorage /// Create a new lock. - @usableFromInline + @inlinable init() { self._storage = .create(value: ()) } @@ -225,9 +254,7 @@ struct Lock { } @inlinable - internal func withLockPrimitive( - _ body: (UnsafeMutablePointer) throws -> T - ) rethrows -> T { + internal func withLockPrimitive(_ body: (UnsafeMutablePointer) throws -> T) rethrows -> T { try self._storage.withLockPrimitive(body) } } @@ -249,9 +276,14 @@ extension Lock { } return try body() } + + @inlinable + func withLockVoid(_ body: () throws -> Void) rethrows { + try self.withLock(body) + } } -extension Lock: Sendable {} +extension Lock: @unchecked Sendable {} extension UnsafeMutablePointer { @inlinable @@ -260,20 +292,74 @@ extension UnsafeMutablePointer { } } +/// Provides locked access to `Value`. +/// +/// - Note: ``LockedValueBox`` has reference semantics and holds the `Value` +/// alongside a lock behind a reference. +/// +/// This is no different than creating a ``Lock`` and protecting all +/// accesses to a value using the lock. But it's easy to forget to actually +/// acquire/release the lock in the correct place. ``LockedValueBox`` makes +/// that much easier. @usableFromInline struct LockedValueBox { - @usableFromInline - let storage: LockStorage @usableFromInline + internal let _storage: LockStorage + + /// Initialize the `Value`. + @inlinable init(_ value: Value) { - self.storage = .create(value: value) + self._storage = .create(value: value) } + /// Access the `Value`, allowing mutation of it. @inlinable func withLockedValue(_ mutate: (inout Value) throws -> T) rethrows -> T { - try self.storage.withLockedValue(mutate) + try self._storage.withLockedValue(mutate) + } + + /// Provides an unsafe view over the lock and its value. + /// + /// This can be beneficial when you require fine grained control over the lock in some + /// situations but don't want lose the benefits of ``withLockedValue(_:)`` in others by + /// switching to ``NIOLock``. + var unsafe: Unsafe { + Unsafe(_storage: self._storage) + } + + /// Provides an unsafe view over the lock and its value. + struct Unsafe { + @usableFromInline + let _storage: LockStorage + + /// Manually acquire the lock. + @inlinable + func lock() { + self._storage.lock() + } + + /// Manually release the lock. + @inlinable + func unlock() { + self._storage.unlock() + } + + /// Mutate the value, assuming the lock has been acquired manually. + /// + /// - Parameter mutate: A closure with scoped access to the value. + /// - Returns: The result of the `mutate` closure. + @inlinable + func withValueAssumingLockIsAcquired( + _ mutate: (_ value: inout Value) throws -> Result + ) rethrows -> Result { + try self._storage.withUnsafeMutablePointerToHeader { value in + try mutate(&value.pointee) + } + } } } -extension LockedValueBox: Sendable where Value: Sendable {} +extension LockedValueBox: @unchecked Sendable where Value: Sendable {} + +extension LockedValueBox.Unsafe: @unchecked Sendable where Value: Sendable {} From 9a8ae28208f66ea0d6539cb4487a380933a2877c Mon Sep 17 00:00:00 2001 From: Si Beaumont Date: Tue, 7 Oct 2025 15:29:05 +0100 Subject: [PATCH 5/8] Update BufferedStream to only be generic over Sendable Element --- Sources/OpenAPIURLSession/BufferedStream/BufferedStream.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/OpenAPIURLSession/BufferedStream/BufferedStream.swift b/Sources/OpenAPIURLSession/BufferedStream/BufferedStream.swift index 60b5dca..6b30d21 100644 --- a/Sources/OpenAPIURLSession/BufferedStream/BufferedStream.swift +++ b/Sources/OpenAPIURLSession/BufferedStream/BufferedStream.swift @@ -130,7 +130,7 @@ import DequeModule /// @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) @usableFromInline -internal struct BufferedStream { +internal struct BufferedStream { @usableFromInline final class _Backing: Sendable { @usableFromInline From c2248340c510b192d6adaa2ca799f06ae26a039f Mon Sep 17 00:00:00 2001 From: Si Beaumont Date: Tue, 7 Oct 2025 15:29:22 +0100 Subject: [PATCH 6/8] Fix sendable issues with global locked value boxes --- Sources/OpenAPIURLSession/URLSessionTransport.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/OpenAPIURLSession/URLSessionTransport.swift b/Sources/OpenAPIURLSession/URLSessionTransport.swift index 5b8b269..65dd92e 100644 --- a/Sources/OpenAPIURLSession/URLSessionTransport.swift +++ b/Sources/OpenAPIURLSession/URLSessionTransport.swift @@ -291,12 +291,12 @@ extension URLSessionTransportError: CustomStringConvertible { } } -private let _debugLoggingEnabled = LockStorage.create(value: false) +private let _debugLoggingEnabled = LockedValueBox(false) var debugLoggingEnabled: Bool { get { _debugLoggingEnabled.withLockedValue { $0 } } set { _debugLoggingEnabled.withLockedValue { $0 = newValue } } } -private let _standardErrorLock = LockStorage.create(value: FileHandle.standardError) +private let _standardErrorLock = LockedValueBox(FileHandle.standardError) func debug(_ message: @autoclosure () -> String, function: String = #function, file: String = #file, line: UInt = #line) { assert( From 5268318073122060070c63d68ee2e0b649d0b1e7 Mon Sep 17 00:00:00 2001 From: Si Beaumont Date: Tue, 7 Oct 2025 16:10:05 +0100 Subject: [PATCH 7/8] Formatting --- Sources/OpenAPIURLSession/BufferedStream/Lock.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/OpenAPIURLSession/BufferedStream/Lock.swift b/Sources/OpenAPIURLSession/BufferedStream/Lock.swift index aa4ac1a..589a84c 100644 --- a/Sources/OpenAPIURLSession/BufferedStream/Lock.swift +++ b/Sources/OpenAPIURLSession/BufferedStream/Lock.swift @@ -11,6 +11,7 @@ // SPDX-License-Identifier: Apache-2.0 // //===----------------------------------------------------------------------===// +// swift-format-ignore-file //===----------------------------------------------------------------------===// // // This source file is part of the SwiftNIO open source project From d0025df836b11d2911547d91e37be8abe531b140 Mon Sep 17 00:00:00 2001 From: Si Beaumont Date: Tue, 7 Oct 2025 16:12:09 +0100 Subject: [PATCH 8/8] Formatting --- Tests/OpenAPIURLSessionTests/NIOAsyncHTTP1TestServer.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/OpenAPIURLSessionTests/NIOAsyncHTTP1TestServer.swift b/Tests/OpenAPIURLSessionTests/NIOAsyncHTTP1TestServer.swift index aad5f3d..772a6b6 100644 --- a/Tests/OpenAPIURLSessionTests/NIOAsyncHTTP1TestServer.swift +++ b/Tests/OpenAPIURLSessionTests/NIOAsyncHTTP1TestServer.swift @@ -19,8 +19,8 @@ import NIOHTTP1 final class AsyncTestHTTP1Server { - typealias ConnectionHandler = @Sendable (NIOAsyncChannel) - async throws -> Void + typealias ConnectionHandler = + @Sendable (NIOAsyncChannel) async throws -> Void /// Use `start(host:port:connectionHandler:)` instead. private init() {}