Skip to content

Commit

Permalink
feat: Add a Error::is_connect() method (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubadamw authored Jan 29, 2024
1 parent 5c35f28 commit 32166f6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/client/legacy/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1516,6 +1516,11 @@ 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)
}

fn is_canceled(&self) -> bool {
matches!(self.kind, ErrorKind::Canceled)
}
Expand Down

0 comments on commit 32166f6

Please sign in to comment.