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() }