From b4cffe2339067d1a7229a3dd7a30bf38493c1e73 Mon Sep 17 00:00:00 2001 From: dobefore <46564102+dobefore@users.noreply.github.com> Date: Tue, 31 May 2022 15:52:12 +0800 Subject: [PATCH] rust impl stdError trait (#1890) * impl stdError trait * Update CONTRIBUTORS --- CONTRIBUTORS | 1 + rslib/src/error/mod.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 0eafd0e5e..0727fd2e7 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -101,6 +101,7 @@ Patric Cunha Brayan Oliveira Luka Warren wisherhxl +dobefore <1432338032@qq.com> ******************** diff --git a/rslib/src/error/mod.rs b/rslib/src/error/mod.rs index 4c1eae0a7..fe3a9b56a 100644 --- a/rslib/src/error/mod.rs +++ b/rslib/src/error/mod.rs @@ -51,6 +51,8 @@ pub enum AnkiError { ImportError(ImportError), } +impl std::error::Error for AnkiError {} + impl Display for AnkiError { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "{:?}", self)