Skip to content

Commit 250469c

Browse files
committed
rename method
1 parent bbebb5e commit 250469c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Sources/Timeout.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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.")

Tests/withThrowingTimeoutTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)