Skip to content

Commit c2e2219

Browse files
adityaramanikatiewasnothere
authored andcommitted
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 <[email protected]>
1 parent 8ecbd12 commit c2e2219

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Sources/ContainerizationOCI/Client/LocalOCILayoutClient.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ package final class LocalOCILayoutClient: ContentClient {
7373
) async throws where T.Element == ByteBuffer {
7474
let input = try streamGenerator()
7575

76-
try await self.cs.ingest { dir in
76+
let (id, dir) = try await self.cs.newIngestSession()
77+
do {
7778
let into = dir.appendingPathComponent(descriptor.digest.trimmingDigestPrefix)
7879
guard FileManager.default.createFile(atPath: into.path, contents: nil) else {
7980
throw Error.cannotCreateFile
@@ -96,6 +97,9 @@ package final class LocalOCILayoutClient: ContentClient {
9697
}
9798
}
9899
}
100+
try await self.cs.completeIngestSession(id)
101+
} catch {
102+
try await self.cs.cancelIngestSession(id)
99103
}
100104
}
101105
}

0 commit comments

Comments
 (0)