From 8421df8fe197fcf965d7ffe5b048077ffa7df447 Mon Sep 17 00:00:00 2001 From: Daniel Hofstetter Date: Tue, 30 Sep 2025 11:04:21 +0200 Subject: [PATCH] clippy: re-enable bool_to_int_with_if lint --- Cargo.toml | 1 - src/uucore/src/lib/features/checksum.rs | 2 +- src/uucore/src/lib/features/quoting_style/shell_quoter.rs | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e7e6261cf..56842be0b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -692,7 +692,6 @@ borrow_as_ptr = "allow" ptr_as_ptr = "allow" manual_let_else = "allow" unnecessary_semicolon = "allow" -bool_to_int_with_if = "allow" needless_raw_string_hashes = "allow" unreadable_literal = "allow" unnested_or_patterns = "allow" diff --git a/src/uucore/src/lib/features/checksum.rs b/src/uucore/src/lib/features/checksum.rs index 86e1f54f0..159620418 100644 --- a/src/uucore/src/lib/features/checksum.rs +++ b/src/uucore/src/lib/features/checksum.rs @@ -483,7 +483,7 @@ impl LineFormat { // r"\MD5 (a\\ b) = abc123", // BLAKE2b(44)= a45a4c4883cce4b50d844fab460414cc2080ca83690e74d850a9253e757384366382625b218c8585daee80f34dc9eb2f2fde5fb959db81cd48837f9216e7b0fa let trimmed = line.trim_ascii_start(); - let algo_start = if trimmed.starts_with(b"\\") { 1 } else { 0 }; + let algo_start = usize::from(trimmed.starts_with(b"\\")); let rest = &trimmed[algo_start..]; enum SubCase { diff --git a/src/uucore/src/lib/features/quoting_style/shell_quoter.rs b/src/uucore/src/lib/features/quoting_style/shell_quoter.rs index 0fc5cd38c..58d3b3e8d 100644 --- a/src/uucore/src/lib/features/quoting_style/shell_quoter.rs +++ b/src/uucore/src/lib/features/quoting_style/shell_quoter.rs @@ -212,7 +212,7 @@ fn shell_escaped_char_set(is_dirname: bool) -> &'static [u8] { // the ':' colon character only induce quoting in the // context of ls displaying a directory name before listing its content. // (e.g. with the recursive flag -R) - let start_index = if is_dirname { 0 } else { 1 }; + let start_index = usize::from(!is_dirname); &ESCAPED_CHARS[start_index..] }