Special case EventLoopPromise.succeed() when Value is Void (#2311)

Co-authored-by: OleksandrZhurba <56148913+OleksandrZhurba@users.noreply.github.com>
This commit is contained in:
Oleksandr Zhurba 2023-01-19 19:06:07 +02:00 committed by GitHub
parent 3d18e94683
commit 555f1db039
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -2218,3 +2218,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<Void>` object.
@inlinable
public func succeed() {
succeed(Void())
}
}