Skip to content

Commit 6c7b2af

Browse files
committed
Remove await from spawnUnlessCancelled
spawnUnlessCancelled is not an asynchronous function, so awaiting on it in the standard library resulted in warnings.
1 parent f7fb5a1 commit 6c7b2af

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stdlib/public/Concurrency/TaskGroup.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ public struct TaskGroup<ChildTaskResult: Sendable> {
215215
priority: Task.Priority = .unspecified,
216216
operation: __owned @Sendable @escaping () async -> ChildTaskResult
217217
) async -> Bool {
218-
return try await self.spawnUnlessCancelled(priority: priority) {
218+
return try self.spawnUnlessCancelled(priority: priority) {
219219
await operation()
220220
}
221221
}
@@ -467,7 +467,7 @@ public struct ThrowingTaskGroup<ChildTaskResult: Sendable, Failure: Error> {
467467
priority: Task.Priority = .unspecified,
468468
operation: __owned @Sendable @escaping () async throws -> ChildTaskResult
469469
) async -> Bool {
470-
return try await self.spawnUnlessCancelled(priority: priority) {
470+
return try self.spawnUnlessCancelled(priority: priority) {
471471
try await operation()
472472
}
473473
}

0 commit comments

Comments
 (0)