From 46ad6275ba918b254910af6d08dfc46896b71ef7 Mon Sep 17 00:00:00 2001 From: Mo8it Date: Fri, 30 Dec 2022 14:54:14 +0100 Subject: [PATCH] Remove unneeded async --- src/extractors.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/extractors.rs b/src/extractors.rs index 0c963e6..f8759eb 100644 --- a/src/extractors.rs +++ b/src/extractors.rs @@ -37,7 +37,7 @@ where } impl ReceivedSignature { - pub async fn is_valid(&self, secret: &[u8], body: &[u8]) -> bool { + pub fn is_valid(&self, secret: &[u8], body: &[u8]) -> bool { let mut mac = Hmac::::new_from_slice(secret) .expect("Can not generate a mac from the secret!"); mac.update(body); @@ -69,10 +69,7 @@ where let state_config = state.config(); - if !received_signature - .is_valid(&state_config.secret, &body) - .await - { + if !received_signature.is_valid(&state_config.secret, &body) { return Err("Invalid signature!".into()); }