Impl PartialEq for ErrorKind

Closes #125
This commit is contained in:
Vincent Prouillet 2021-02-19 21:13:20 +01:00
parent 5c706b005a
commit d2c8ae3f11
2 changed files with 6 additions and 1 deletions

View File

@ -262,7 +262,6 @@ pub fn dangerous_insecure_decode_with_validation<T: DeserializeOwned>(
Ok(TokenData { header, claims: decoded_claims })
}
/// Decode a JWT without any signature verification/validations and return its [Header](struct.Header.html).
///
/// If the token has an invalid format (ie 3 parts separated by a `.`), it will return an error.

View File

@ -123,6 +123,12 @@ impl fmt::Display for Error {
}
}
impl PartialEq for ErrorKind {
fn eq(&self, other: &Self) -> bool {
format!("{:?}", self) == format!("{:?}", other)
}
}
impl From<base64::DecodeError> for Error {
fn from(err: base64::DecodeError) -> Error {
new_error(ErrorKind::Base64(err))