From a0ee05d7908ecb4cd2edead21fdeac0f1d0c1022 Mon Sep 17 00:00:00 2001 From: simonsan <14062932+simonsan@users.noreply.github.com> Date: Sun, 27 Oct 2024 04:52:51 +0100 Subject: [PATCH] use `is_code` Signed-off-by: simonsan <14062932+simonsan@users.noreply.github.com> --- crates/core/src/error.rs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/crates/core/src/error.rs b/crates/core/src/error.rs index ab39b15c..892302ca 100644 --- a/crates/core/src/error.rs +++ b/crates/core/src/error.rs @@ -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.