Skip to content

Commit 987cf35

Browse files
committed
sending T
1 parent 54c8ca7 commit 987cf35

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Sources/Timeout.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public func withThrowingTimeout<T>(
4848
try await _withThrowingTimeout(isolation: isolation, body: body) {
4949
try await Task.sleep(nanoseconds: UInt64(seconds * 1_000_000_000))
5050
throw TimeoutError("Task timed out before completion. Timeout: \(seconds) seconds.")
51-
}.value
51+
}
5252
}
5353

5454
@available(macOS 13.0, iOS 16.0, tvOS 16.0, watchOS 9.0, *)
@@ -62,7 +62,7 @@ public func withThrowingTimeout<T, C: Clock>(
6262
try await _withThrowingTimeout(isolation: isolation, body: body) {
6363
try await Task.sleep(until: instant, tolerance: tolerance, clock: clock)
6464
throw TimeoutError("Task timed out before completion. Deadline: \(instant).")
65-
}.value
65+
}
6666
}
6767

6868
@available(macOS 13.0, iOS 16.0, tvOS 16.0, watchOS 9.0, *)
@@ -75,14 +75,14 @@ public func withThrowingTimeout<T>(
7575
try await _withThrowingTimeout(isolation: isolation, body: body) {
7676
try await Task.sleep(until: instant, tolerance: tolerance, clock: ContinuousClock())
7777
throw TimeoutError("Task timed out before completion. Deadline: \(instant).")
78-
}.value
78+
}
7979
}
8080

8181
private func _withThrowingTimeout<T>(
8282
isolation: isolated (any Actor)? = #isolation,
8383
body: () async throws -> sending T,
8484
timeout: @Sendable @escaping () async throws -> Never
85-
) async throws -> Transferring<T> {
85+
) async throws -> sending T {
8686
try await withoutActuallyEscaping(body) { escapingBody in
8787
let bodyTask = Task {
8888
defer { _ = isolation }
@@ -106,7 +106,7 @@ private func _withThrowingTimeout<T>(
106106
} else {
107107
return try bodyResult.get()
108108
}
109-
}
109+
}.value
110110
}
111111

112112
private struct Transferring<Value>: Sendable {

0 commit comments

Comments
 (0)