Remove silly match

This commit is contained in:
Vincent Prouillet 2016-08-23 18:03:33 +01:00
parent b00a28e9c9
commit 257218bc14
1 changed files with 1 additions and 4 deletions

View File

@ -141,10 +141,7 @@ pub fn sign(data: &str, secret: &[u8], algorithm: Algorithm) -> String {
/// Compares the signature given with a re-computed signature
pub fn verify(signature: &str, data: &str, secret: &[u8], algorithm: Algorithm) -> bool {
match verify_slices_are_equal(signature.as_ref(), sign(data, secret, algorithm).as_ref()) {
Ok(()) => true,
Err(_) => false,
}
verify_slices_are_equal(signature.as_ref(), sign(data, secret, algorithm).as_ref()).is_ok()
}
/// Encode the claims passed and sign the payload using the algorithm from the header and the secret