Skip to content

Commit

Permalink
Address linting feedback
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ewalk153 committed Jul 2, 2024
1 parent 65fe672 commit f379f9a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/javy/src/apis/cryptox/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ fn hmac_sha256(args: Args<'_>) -> Result<Value<'_>> {
/// Create alias for HMAC-SHA256
type HmacSha256 = Hmac<Sha256>;

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();
Expand Down

0 comments on commit f379f9a

Please sign in to comment.