mirror of
https://github.com/apple/container.git
synced 2026-09-09 09:15:42 +00:00
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:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user