From ca3b0d3bb8968a3f690429d5910f177b533d6bce Mon Sep 17 00:00:00 2001 From: OleksandrZhurba <56148913+OleksandrZhurba@users.noreply.github.com> Date: Fri, 11 Nov 2022 15:56:52 +0100 Subject: [PATCH] Special case EventLoopPromise.succeed() when Value is Void --- Sources/NIOCore/EventLoopFuture.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Sources/NIOCore/EventLoopFuture.swift b/Sources/NIOCore/EventLoopFuture.swift index 3b04e6c8a9..2a7799ea1b 100644 --- a/Sources/NIOCore/EventLoopFuture.swift +++ b/Sources/NIOCore/EventLoopFuture.swift @@ -2190,3 +2190,11 @@ extension EventLoopPromise: Sendable { } // that by way of the guarantees of the EventLoop protocol, so the compiler cannot // check it. extension EventLoopFuture: @unchecked Sendable { } + +extension EventLoopPromise where Value == Void { + // Deliver a successful result to the associated `EventLoopFuture` object. + @inlinable + public func succeed() { + succeed(Void()) + } +}