Skip to content

Commit 32166f6

Browse files
authored
feat: Add a Error::is_connect() method (#95)
1 parent 5c35f28 commit 32166f6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/client/legacy/client.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,6 +1516,11 @@ impl StdError for Error {
15161516
}
15171517

15181518
impl Error {
1519+
/// Returns true if this was an error from `Connect`.
1520+
pub fn is_connect(&self) -> bool {
1521+
matches!(self.kind, ErrorKind::Connect)
1522+
}
1523+
15191524
fn is_canceled(&self) -> bool {
15201525
matches!(self.kind, ErrorKind::Canceled)
15211526
}

0 commit comments

Comments
 (0)