Fix spelling of detach (#1865)

Motivation:

The spelling of detach changed. This patch adopts the new spelling.

Modifications:

Changed detach to Task.detached.

Result:

5.5 should build again.
This commit is contained in:
Cory Benfield 2021-06-01 10:33:06 +01:00 committed by GitHub
parent 43fa7686db
commit 47b3501592
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -66,7 +66,7 @@ func main() async {
let dg = DispatchGroup()
dg.enter()
if #available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *) {
detach {
Task.detached {
await main()
dg.leave()
}

View File

@ -47,7 +47,7 @@ extension EventLoopPromise {
/// - parameters:
/// - body: The `async` function to run.
public func completeWithAsync(_ body: @escaping () async throws -> Value) {
detach {
Task.detached {
do {
let value = try await body()
self.succeed(value)