Implement std::error::Error for totp-rs error types

Signed-off-by: constantoine <cleo.rebert-ext@treezor.com>
This commit is contained in:
constantoine 2022-11-02 11:29:04 +01:00
parent c36b3a9507
commit d241e00fcf
No known key found for this signature in database
GPG Key ID: 0FA097951CF65367
2 changed files with 4 additions and 0 deletions

View File

@ -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 {

View File

@ -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 {