Skip to content

Commit

Permalink
use is_code
Browse files Browse the repository at this point in the history
Signed-off-by: simonsan <[email protected]>
  • Loading branch information
simonsan committed Oct 27, 2024
1 parent 4e19c26 commit a0ee05d
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions crates/core/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,16 +212,9 @@ impl RusticError {
.map_or(false, |c| c.as_str() == code)
}

/// Expose the inner error kind.
///
/// This is useful for matching on the error kind.
pub fn into_inner(self) -> ErrorKind {
self.kind
}

/// Checks if the error is due to an incorrect password
pub fn is_incorrect_password(&self) -> bool {
matches!(self.error_code.as_deref(), Some("C002"))
self.is_code("C002")
}

/// Creates a new error from a given error.
Expand Down

0 comments on commit a0ee05d

Please sign in to comment.