From 41bd413ff19e01a0fa61a5995119b0e396805cb6 Mon Sep 17 00:00:00 2001 From: sanketh Date: Sat, 16 Sep 2023 04:28:49 -0400 Subject: [PATCH] fix clippy warning --- ocb3/src/lib.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ocb3/src/lib.rs b/ocb3/src/lib.rs index 6aec629d..4c82d071 100644 --- a/ocb3/src/lib.rs +++ b/ocb3/src/lib.rs @@ -436,12 +436,12 @@ fn nonce_dependent_variables< let mut Nonce = u128::from_be_bytes(Nonce); // Nonce = num2str(TAGLEN mod 128,7) || zeros(120-bitlen(N)) || 1 || N Nonce |= 1 << 96; - if tag_len == 16 { - // do nothing because 128 mod 128 = 0 - } else if tag_len < 16 { - Nonce |= (u128::from(tag_len) * 8) << (128 - 7); - } else { - unreachable!(); + match tag_len { + 16 => {} + x if x < 16 => { + Nonce |= (u128::from(tag_len) * 8) << (128 - 7); + } + _ => unreachable!(), } // Separate the last 6 bits into `bottom`, and the rest into `top`.