From d6891668e72562ba64f5859c1a17aa9a3ce5ad2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Thu, 9 Jan 2025 12:35:13 +0100 Subject: [PATCH] chore: Fix a clippy warning about precedence of some bit-level operators --- src/sas.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sas.rs b/src/sas.rs index 0912601a..033ee863 100644 --- a/src/sas.rs +++ b/src/sas.rs @@ -201,9 +201,9 @@ impl SasBytes { // This bitwise operation is taken from the [spec] // [spec]: https://matrix.org/docs/spec/client_server/latest#sas-method-decimal - let first = bytes[0] << 5 | bytes[1] >> 3; - let second = (bytes[1] & 0x7) << 10 | bytes[2] << 2 | bytes[3] >> 6; - let third = (bytes[3] & 0x3F) << 7 | bytes[4] >> 1; + let first = (bytes[0] << 5) | (bytes[1] >> 3); + let second = ((bytes[1] & 0x7) << 10) | (bytes[2] << 2) | (bytes[3] >> 6); + let third = ((bytes[3] & 0x3F) << 7) | (bytes[4] >> 1); (first + 1000, second + 1000, third + 1000) }