Skip to content

Commit 61d2f73

Browse files
authored
ContainerRegistry: Prefer generic parameters to existentials (#150)
Motivation ---------- A generic parameter is preferable to an `any` parameter, where possible. Modifications ------------- * Make blob parameter generic instead of existential in ImageReference.Digest(of: Blob) Result ------ No functional change. Test Plan --------- All existing tests continue to pass.
1 parent cf92449 commit 61d2f73

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/ContainerRegistry/ImageReference+Digest.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ extension ImageReference.Digest {
2929
/// - Parameters:
3030
/// - data: Blob of data to digest.
3131
/// - algorithm: Digest algorithm to use.
32-
public init(
33-
of data: any DataProtocol,
32+
public init<Blob: DataProtocol>(
33+
of data: Blob,
3434
algorithm: ImageReference.Digest.Algorithm = .sha256
3535
) {
3636
// SHA256 is required; some registries might also support SHA512

0 commit comments

Comments
 (0)