From d71946c883648d897f8f06dcaba1b95db08f78ae Mon Sep 17 00:00:00 2001 From: ossian Date: Wed, 24 Aug 2022 22:01:20 -0400 Subject: [PATCH] fix: compile error --- src/util.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util.rs b/src/util.rs index 119a5a4..0aa5a8f 100644 --- a/src/util.rs +++ b/src/util.rs @@ -1,5 +1,5 @@ use base32::Alphabet; -use hmac::{Hmac, Mac}; +use hmac::{digest::KeyInit, Hmac, Mac}; use sha1::Sha1; use sha2::{Sha256, Sha512}; use std::collections::HashMap; @@ -62,8 +62,8 @@ pub(crate) fn hash_generic(msg: &[u8], secret: &[u8], digest: &MacDigest) -> Vec /// # Panics /// The method will panic if the provided secret is invalid and a hash /// cannot be generated. -fn hash_internal(msg: &[u8], secret: &[u8]) -> Vec { - let mut hmac = ::new_from_slice(secret).expect("Failed to initialize HMAC"); +fn hash_internal(msg: &[u8], secret: &[u8]) -> Vec { + let mut hmac = ::new_from_slice(secret).expect("Failed to initialize HMAC"); hmac.update(msg); hmac.finalize().into_bytes()[..].into() }