From 77cc3dafb9a984747ecace99505b47c6baaec794 Mon Sep 17 00:00:00 2001 From: Andreas Bauer Date: Thu, 11 Jul 2024 15:11:11 +0200 Subject: [PATCH] Fix Sendable closure annotation --- Sources/SpeziFoundation/Misc/TimeoutError.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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