From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <pbs-devel-bounces@lists.proxmox.com> Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 8EAA01FF16B for <inbox@lore.proxmox.com>; Thu, 6 Mar 2025 13:44:20 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id A3C205B39; Thu, 6 Mar 2025 13:44:15 +0100 (CET) From: Shannon Sterz <s.sterz@proxmox.com> To: pbs-devel@lists.proxmox.com Date: Thu, 6 Mar 2025 13:43:32 +0100 Message-Id: <20250306124349.288370-3-s.sterz@proxmox.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250306124349.288370-1-s.sterz@proxmox.com> References: <20250306124349.288370-1-s.sterz@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 1 AWL -0.062 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy FSL_BULK_SIG 0.001 Bulk signature with no Unsubscribe KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RAZOR2_CF_RANGE_51_100 1.886 Razor2 gives confidence level above 50% RAZOR2_CHECK 0.922 Listed in Razor2 (http://razor.sf.net/) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_SBL_A 0.1 Contains URL's A record listed in the Spamhaus SBL blocklist [185.199.111.153, 185.199.110.153] Subject: [pbs-devel] [PATCH proxmox 02/19] tree-wide: add parantheses to clarify precedence X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion <pbs-devel.lists.proxmox.com> List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pbs-devel>, <mailto:pbs-devel-request@lists.proxmox.com?subject=unsubscribe> List-Archive: <http://lists.proxmox.com/pipermail/pbs-devel/> List-Post: <mailto:pbs-devel@lists.proxmox.com> List-Help: <mailto:pbs-devel-request@lists.proxmox.com?subject=help> List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel>, <mailto:pbs-devel-request@lists.proxmox.com?subject=subscribe> Reply-To: Proxmox Backup Server development discussion <pbs-devel@lists.proxmox.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pbs-devel-bounces@lists.proxmox.com Sender: "pbs-devel" <pbs-devel-bounces@lists.proxmox.com> this resolves a clippy lint that aims to improve legibility for people unaware of rust's precendence rules [1]. [1]: https://rust-lang.github.io/rust-clippy/master/index.html#precedence Signed-off-by: Shannon Sterz <s.sterz@proxmox.com> --- proxmox-compression/src/zip.rs | 2 +- proxmox-schema/src/upid.rs | 2 +- proxmox-sys/src/systemd.rs | 2 +- proxmox-systemd/src/escape.rs | 2 +- proxmox-uuid/src/lib.rs | 12 ++++++------ 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/proxmox-compression/src/zip.rs b/proxmox-compression/src/zip.rs index 3ccece9b..11b29de4 100644 --- a/proxmox-compression/src/zip.rs +++ b/proxmox-compression/src/zip.rs @@ -360,7 +360,7 @@ impl ZipEntry { comment_len: 0, start_disk: 0, internal_flags: 0, - external_flags: (self.mode as u32) << 16 | (!self.is_file as u32) << 4, + external_flags: ((self.mode as u32) << 16) | ((!self.is_file as u32) << 4), offset, }, ) diff --git a/proxmox-schema/src/upid.rs b/proxmox-schema/src/upid.rs index 9bbb66a1..897fa76a 100644 --- a/proxmox-schema/src/upid.rs +++ b/proxmox-schema/src/upid.rs @@ -191,7 +191,7 @@ fn unescape_id(text: &str) -> Result<String, Error> { } let h1 = hex_digit(i[2])?; let h0 = hex_digit(i[3])?; - data.push(h1 << 4 | h0); + data.push((h1 << 4) | h0); i = &i[4..] } else if next == b'-' { data.push(b'/'); diff --git a/proxmox-sys/src/systemd.rs b/proxmox-sys/src/systemd.rs index 43dc5185..d57f5816 100644 --- a/proxmox-sys/src/systemd.rs +++ b/proxmox-sys/src/systemd.rs @@ -90,7 +90,7 @@ fn unescape_unit_do(text: &str) -> Result<Vec<u8>, Error> { } let h1 = parse_hex_digit(i[2])?; let h0 = parse_hex_digit(i[3])?; - data.push(h1 << 4 | h0); + data.push((h1 << 4) | h0); i = &i[4..] } else if next == b'-' { data.push(b'/'); diff --git a/proxmox-systemd/src/escape.rs b/proxmox-systemd/src/escape.rs index f73beed3..392907bc 100644 --- a/proxmox-systemd/src/escape.rs +++ b/proxmox-systemd/src/escape.rs @@ -97,7 +97,7 @@ fn unescape_unit_do(text: &str) -> Result<Vec<u8>, UnescapeError> { } let h1 = parse_hex_digit(i[2])?; let h0 = parse_hex_digit(i[3])?; - data.push(h1 << 4 | h0); + data.push((h1 << 4) | h0); i = &i[4..] } else if next == b'-' { data.push(b'/'); diff --git a/proxmox-uuid/src/lib.rs b/proxmox-uuid/src/lib.rs index 09a70b49..800a8563 100644 --- a/proxmox-uuid/src/lib.rs +++ b/proxmox-uuid/src/lib.rs @@ -103,25 +103,25 @@ impl Uuid { return Err(UuidError); } for i in 0..4 { - uuid[i] = hex_digit(src[2 * i])? << 4 | hex_digit(src[2 * i + 1])?; + uuid[i] = (hex_digit(src[2 * i])? << 4) | hex_digit(src[2 * i + 1])?; } for i in 4..6 { - uuid[i] = hex_digit(src[2 * i + 1])? << 4 | hex_digit(src[2 * i + 2])?; + uuid[i] = (hex_digit(src[2 * i + 1])? << 4) | hex_digit(src[2 * i + 2])?; } for i in 6..8 { - uuid[i] = hex_digit(src[2 * i + 2])? << 4 | hex_digit(src[2 * i + 3])?; + uuid[i] = (hex_digit(src[2 * i + 2])? << 4) | hex_digit(src[2 * i + 3])?; } for i in 8..10 { - uuid[i] = hex_digit(src[2 * i + 3])? << 4 | hex_digit(src[2 * i + 4])?; + uuid[i] = (hex_digit(src[2 * i + 3])? << 4) | hex_digit(src[2 * i + 4])?; } for i in 10..16 { - uuid[i] = hex_digit(src[2 * i + 4])? << 4 | hex_digit(src[2 * i + 5])?; + uuid[i] = (hex_digit(src[2 * i + 4])? << 4) | hex_digit(src[2 * i + 5])?; } } else if src.len() == 32 { let uuid: &mut [u8] = unsafe { &mut (*uuid)[..] }; let src = src.as_bytes(); for i in 0..16 { - uuid[i] = hex_digit(src[2 * i])? << 4 | hex_digit(src[2 * i + 1])?; + uuid[i] = (hex_digit(src[2 * i])? << 4) | hex_digit(src[2 * i + 1])?; } } else { return Err(UuidError); -- 2.39.5 _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel