1
0
Fork 0
mirror of https://codeberg.org/Mo8it/git-webhook-client synced 2024-11-21 11:06:32 +00:00

Thanks clippy

This commit is contained in:
Mo 2022-10-10 18:04:22 +02:00
parent 1220f6635e
commit b33f8e5254

View file

@ -65,9 +65,9 @@ fn get_hook_commands(clone_url: &str) -> Option<Vec<String>> {
None
}
fn is_valid_signature(received_signature: &Vec<u8>, payload: &Vec<u8>) -> bool {
fn is_valid_signature(received_signature: &[u8], payload: &[u8]) -> bool {
let mut mac = Hmac::<Sha256>::new_from_slice(&get_secret()).unwrap();
mac.update(&payload);
mac.update(payload);
let expected_signature = mac.finalize().into_bytes();
received_signature[..] == expected_signature[..]