From c7acf8968d96a4408e952a097d93602d2e8ed01a Mon Sep 17 00:00:00 2001 From: Jakub Wieczorek Date: Thu, 28 Dec 2023 12:51:21 +0100 Subject: [PATCH 1/2] Add the removed `Error::is_connect()` method. --- src/client/legacy/client.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/client/legacy/client.rs b/src/client/legacy/client.rs index cf92d5b..8511a11 100644 --- a/src/client/legacy/client.rs +++ b/src/client/legacy/client.rs @@ -1516,6 +1516,10 @@ impl StdError for Error { } impl Error { + pub fn is_connect(&self) -> bool { + matches!(self.kind, ErrorKind::Connect) + } + fn is_canceled(&self) -> bool { matches!(self.kind, ErrorKind::Canceled) } From 1902dfacb02293c66cc5743e12178ce90b5b0611 Mon Sep 17 00:00:00 2001 From: Jakub Wieczorek Date: Mon, 29 Jan 2024 21:36:04 +0100 Subject: [PATCH 2/2] Add the comment from review feedback Co-authored-by: Sean McArthur --- src/client/legacy/client.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/client/legacy/client.rs b/src/client/legacy/client.rs index 8511a11..6043f02 100644 --- a/src/client/legacy/client.rs +++ b/src/client/legacy/client.rs @@ -1516,6 +1516,7 @@ impl StdError for Error { } impl Error { + /// Returns true if this was an error from `Connect`. pub fn is_connect(&self) -> bool { matches!(self.kind, ErrorKind::Connect) }