From 2da187597a6e90a792bd648aca2138ca7f6289f6 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 21 Sep 2025 17:28:59 +0200 Subject: [PATCH] hashsum: remove the usage of the mut --- src/uu/hashsum/src/hashsum.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/uu/hashsum/src/hashsum.rs b/src/uu/hashsum/src/hashsum.rs index a72ea98fc..d3de97489 100644 --- a/src/uu/hashsum/src/hashsum.rs +++ b/src/uu/hashsum/src/hashsum.rs @@ -498,7 +498,7 @@ pub fn uu_app_custom() -> Command { /// hashsum is handled differently in build.rs /// therefore, this is different from other utilities. fn uu_app(binary_name: &str) -> (Command, bool) { - let (mut command, is_hashsum_bin) = match binary_name { + let (command, is_hashsum_bin) = match binary_name { // These all support the same options. "md5sum" | "sha1sum" | "sha224sum" | "sha256sum" | "sha384sum" | "sha512sum" => { (uu_app_common(), false) @@ -519,12 +519,14 @@ fn uu_app(binary_name: &str) -> (Command, bool) { }; // If not called as generic hashsum, override the command name and usage - if !is_hashsum_bin { + let command = if is_hashsum_bin { + command + } else { let usage = translate!("hashsum-usage-specific", "utility_name" => binary_name); - command = command + command .help_template(uucore::localized_help_template(binary_name)) - .override_usage(format_usage(&usage)); - } + .override_usage(format_usage(&usage)) + }; (command, is_hashsum_bin) }