Skip to content

Commit 42ef73f

Browse files
authored
forEach can be Sendable values; storage already is Sendable (#63)
1 parent de5e3c3 commit 42ef73f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/ServiceContextModule/ServiceContext.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,8 @@ extension ServiceContext {
219219
///
220220
/// - Parameter body: The closure to be invoked for each item stored in this `ServiceContext`,
221221
/// passing the type-erased key and the associated value.
222-
public func forEach(_ body: (AnyServiceContextKey, Any) throws -> Void) rethrows {
222+
@preconcurrency
223+
public func forEach(_ body: (AnyServiceContextKey, any Sendable) throws -> Void) rethrows {
223224
// swift-format-ignore: ReplaceForEachWithForLoop
224225
try self._storage.forEach { key, value in
225226
try body(key, value)

0 commit comments

Comments
 (0)