From 257218bc1477a845139f84f816c8775aa14ecd47 Mon Sep 17 00:00:00 2001 From: Vincent Prouillet Date: Tue, 23 Aug 2016 18:03:33 +0100 Subject: [PATCH] Remove silly match --- src/lib.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 9acb8fd..c62a605 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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