Skip to content

Commit 8df5ba8

Browse files
authored
PackageRegistry: mark PackageVersionMetadata Sendable (#6305)
This allows capturing `PackageVersionMetadata` in `@Sendable` closures. We still have a couple of warnings related to such closures, but this change is a first step towards resolving those in the future. Also marked `RegistryIdentity` as `Sendable` for the same reason.
1 parent 9e11016 commit 8df5ba8

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Sources/PackageModel/PackageIdentity.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public struct PackageIdentity: CustomStringConvertible, Sendable {
7474
self.registry != nil
7575
}
7676

77-
public struct RegistryIdentity: Hashable, CustomStringConvertible {
77+
public struct RegistryIdentity: Hashable, CustomStringConvertible, Sendable {
7878
public let scope: PackageIdentity.Scope
7979
public let name: PackageIdentity.Name
8080
public let underlying: PackageIdentity

Sources/PackageModel/Registry.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import Basics
1414
import struct Foundation.URL
1515

16-
public struct Registry: Hashable, CustomStringConvertible {
16+
public struct Registry: Hashable, CustomStringConvertible, Sendable {
1717
public var url: URL
1818
public var supportsAvailability: Bool
1919

Sources/PackageRegistry/RegistryClient.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1745,7 +1745,7 @@ extension RegistryClient {
17451745
public let alternateLocations: [URL]?
17461746
}
17471747

1748-
public struct PackageVersionMetadata {
1748+
public struct PackageVersionMetadata: Sendable {
17491749
public let registry: Registry
17501750
public let licenseURL: URL?
17511751
public let readmeURL: URL?
@@ -1758,7 +1758,7 @@ extension RegistryClient {
17581758
self.resources.first(where: { $0.name == "source-archive" })
17591759
}
17601760

1761-
public struct Resource {
1761+
public struct Resource: Sendable {
17621762
public let name: String
17631763
public let type: String
17641764
public let checksum: String?
@@ -1772,20 +1772,20 @@ extension RegistryClient {
17721772
}
17731773
}
17741774

1775-
public struct Signing {
1775+
public struct Signing: Sendable {
17761776
public let signatureBase64Encoded: String
17771777
public let signatureFormat: String
17781778
}
17791779

1780-
public struct Author {
1780+
public struct Author: Sendable {
17811781
public let name: String
17821782
public let email: String?
17831783
public let description: String?
17841784
public let organization: Organization?
17851785
public let url: URL?
17861786
}
17871787

1788-
public struct Organization {
1788+
public struct Organization: Sendable {
17891789
public let name: String
17901790
public let email: String?
17911791
public let description: String?

0 commit comments

Comments
 (0)