Bladeren bron

Add `Hashable` conformance to `GRPC.ConnectionTarget` (#1876)

Motivation:

`GRPC.ConnectionTarget` is not `Hashable` and, for example, cannot be stored in a set.

Modifications:

Add `Hashable` conformance to `GRPC.ConnectionTarget`.

Result:

`GRPC.ConnectionTarget` is now `Hashable`.
Clinton Nkwocha 1 jaar geleden
bovenliggende
commit
07eade28c8
1 gewijzigde bestanden met toevoegingen van 2 en 2 verwijderingen
  1. 2 2
      Sources/GRPC/ClientConnection.swift

+ 2 - 2
Sources/GRPC/ClientConnection.swift

@@ -270,8 +270,8 @@ extension ClientConnection: GRPCChannel {
 // MARK: - Configuration structures
 
 /// A target to connect to.
-public struct ConnectionTarget: Sendable {
-  internal enum Wrapped {
+public struct ConnectionTarget: Sendable, Hashable {
+  internal enum Wrapped: Hashable {
     case hostAndPort(String, Int)
     case unixDomainSocket(String)
     case socketAddress(SocketAddress)