소스 검색

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 년 전
부모
커밋
07eade28c8
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  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)