diff --git a/Sources/SpeziFoundation/Misc/TimeoutError.swift b/Sources/SpeziFoundation/Misc/TimeoutError.swift index 0dedba6..8368f00 100644 --- a/Sources/SpeziFoundation/Misc/TimeoutError.swift +++ b/Sources/SpeziFoundation/Misc/TimeoutError.swift @@ -97,7 +97,8 @@ extension TimeoutError: LocalizedError { /// - Parameters: /// - timeout: The duration of the timeout. /// - action: The action to run once the timeout passed. -public func withTimeout(of timeout: Duration, perform action: () async -> Void) async { +@inlinable +public func withTimeout(of timeout: Duration, perform action: @Sendable () async -> Void) async { try? await Task.sleep(for: timeout) guard !Task.isCancelled else { return