File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ public struct Timeout: Sendable {
3737 fileprivate let shared : SharedState
3838
3939 @discardableResult
40- public func expireAfter ( seconds: TimeInterval ) -> Bool {
40+ public func expire ( seconds: TimeInterval ) -> Bool {
4141 enqueue {
4242 try await Task . sleep ( nanoseconds: UInt64 ( seconds * 1_000_000_000 ) )
4343 throw TimeoutError ( " Task timed out before completion. Timeout: \( seconds) seconds. " )
Original file line number Diff line number Diff line change @@ -151,7 +151,7 @@ struct WithThrowingTimeoutTests {
151151 func timeout_ExpiresAfterSeconds( ) async throws {
152152 await #expect( throws: TimeoutError . self) {
153153 try await withThrowingTimeout ( seconds: 1_000 ) { timeout in
154- timeout. expireAfter ( seconds: 0.1 )
154+ timeout. expire ( seconds: 0.1 )
155155 try await Task . sleepIndefinitely ( )
156156 }
157157 }
You can’t perform that action at this time.
0 commit comments