Implement std::error::Error for totp-rs error types
Signed-off-by: constantoine <cleo.rebert-ext@treezor.com>
This commit is contained in:
parent
c36b3a9507
commit
d241e00fcf
|
@ -14,6 +14,8 @@ pub enum Rfc6238Error {
|
||||||
SecretTooSmall(usize),
|
SecretTooSmall(usize),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl std::error::Error for Rfc6238Error {}
|
||||||
|
|
||||||
impl std::fmt::Display for Rfc6238Error {
|
impl std::fmt::Display for Rfc6238Error {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
match self {
|
match self {
|
||||||
|
|
|
@ -22,6 +22,8 @@ pub enum TotpUrlError {
|
||||||
AccountNameDecoding(String),
|
AccountNameDecoding(String),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl std::error::Error for TotpUrlError {}
|
||||||
|
|
||||||
impl std::fmt::Display for TotpUrlError {
|
impl std::fmt::Display for TotpUrlError {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
match self {
|
match self {
|
||||||
|
|
Loading…
Reference in New Issue