Fix compiler warning in LocalOCILayoutClient (#19)

Resolves the warning
```
LocalOCILayoutClient.swift:87:37: warning: capture of non-sendable type 'T.AsyncIterator.Type' in an isolated closure
 87 |             for try await buffer in input {
    |                                     `- warning: capture of non-sendable type 'T.AsyncIterator.Type' in an isolated closure
 88 |                 wrote += buffer.readableBytes
 89 |                 try buffer.withUnsafeReadableBytes { pointer in
```

Signed-off-by: Aditya Ramani <a_ramani@apple.com>
This commit is contained in:
Aditya Ramani
2025-06-05 16:16:32 -07:00
committed by Kathryn Baldauf
parent 8ecbd124e3
commit c2e22192d4
@@ -73,7 +73,8 @@ package final class LocalOCILayoutClient: ContentClient {
) async throws where T.Element == ByteBuffer {
let input = try streamGenerator()
try await self.cs.ingest { dir in
let (id, dir) = try await self.cs.newIngestSession()
do {
let into = dir.appendingPathComponent(descriptor.digest.trimmingDigestPrefix)
guard FileManager.default.createFile(atPath: into.path, contents: nil) else {
throw Error.cannotCreateFile
@@ -96,6 +97,9 @@ package final class LocalOCILayoutClient: ContentClient {
}
}
}
try await self.cs.completeIngestSession(id)
} catch {
try await self.cs.cancelIngestSession(id)
}
}
}