From f379f9a53d10f4498de68be085fdc22ffbc14d69 Mon Sep 17 00:00:00 2001 From: Eric Walker Date: Tue, 2 Jul 2024 10:34:14 -0400 Subject: [PATCH] Address linting feedback HmacSha256::new_from_slice(&js_string_secret.as_bytes()) => HmacSha256::new_from_slice(js_string_secret.as_bytes()) No need to pass in address here. Same for js_string_message. --- crates/javy/src/apis/cryptox/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/javy/src/apis/cryptox/mod.rs b/crates/javy/src/apis/cryptox/mod.rs index b7143376..862db964 100644 --- a/crates/javy/src/apis/cryptox/mod.rs +++ b/crates/javy/src/apis/cryptox/mod.rs @@ -53,9 +53,9 @@ fn hmac_sha256(args: Args<'_>) -> Result> { /// Create alias for HMAC-SHA256 type HmacSha256 = Hmac; - let mut mac = HmacSha256::new_from_slice(&js_string_secret.as_bytes()) + let mut mac = HmacSha256::new_from_slice(js_string_secret.as_bytes()) .expect("HMAC can take key of any size"); - mac.update(&js_string_message.as_bytes()); + mac.update(js_string_message.as_bytes()); let result = mac.finalize(); let code_bytes = result.into_bytes();