Skip to content

Commit 6c44e2d

Browse files
authored
Hashable SocketAddressError (#3119)
Make `SocketAddressError` `Equatable` and `Hashable`. This is useful when running tests that you expect to throw this error as it allows you to write for example ```swift await #expect(throws: SocketAddressError.unknown(host: "127.0.0.1", port: Int.max)) { try await app.startup() } ```
1 parent 5f60cee commit 6c44e2d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/NIOCore/SocketAddresses.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ import WASILibc
5959
#endif
6060

6161
/// Special `Error` that may be thrown if we fail to create a `SocketAddress`.
62-
public enum SocketAddressError: Error {
62+
public enum SocketAddressError: Error, Equatable, Hashable {
6363
/// The host is unknown (could not be resolved).
6464
case unknown(host: String, port: Int)
6565
/// The requested `SocketAddress` is not supported.

0 commit comments

Comments
 (0)