Commit d241e00fcfba0731118f5e6f6a0094c15d5ecd26

constantoine 2022-11-02T11:29:04

Implement std::error::Error for totp-rs error types Signed-off-by: constantoine <cleo.rebert-ext@treezor.com>

diff --git a/src/rfc.rs b/src/rfc.rs
index 34204a7..5863bb6 100644
--- a/src/rfc.rs
+++ b/src/rfc.rs
@@ -14,6 +14,8 @@ pub enum Rfc6238Error {
     SecretTooSmall(usize),
 }
 
+impl std::error::Error for Rfc6238Error {}
+
 impl std::fmt::Display for Rfc6238Error {
     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         match self {
diff --git a/src/url_error.rs b/src/url_error.rs
index 76ef73f..3d63de2 100644
--- a/src/url_error.rs
+++ b/src/url_error.rs
@@ -22,6 +22,8 @@ pub enum TotpUrlError {
     AccountNameDecoding(String),
 }
 
+impl std::error::Error for TotpUrlError {}
+
 impl std::fmt::Display for TotpUrlError {
     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         match self {