Skip to content

Commit e2f5dcb

Browse files
authored
Merge pull request #8692 from sylvestre/hashsum-improv
hashsum: remove the usage of the mut
2 parents dbc5425 + 2da1875 commit e2f5dcb

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/uu/hashsum/src/hashsum.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ pub fn uu_app_custom() -> Command {
498498
/// hashsum is handled differently in build.rs
499499
/// therefore, this is different from other utilities.
500500
fn uu_app(binary_name: &str) -> (Command, bool) {
501-
let (mut command, is_hashsum_bin) = match binary_name {
501+
let (command, is_hashsum_bin) = match binary_name {
502502
// These all support the same options.
503503
"md5sum" | "sha1sum" | "sha224sum" | "sha256sum" | "sha384sum" | "sha512sum" => {
504504
(uu_app_common(), false)
@@ -519,12 +519,14 @@ fn uu_app(binary_name: &str) -> (Command, bool) {
519519
};
520520

521521
// If not called as generic hashsum, override the command name and usage
522-
if !is_hashsum_bin {
522+
let command = if is_hashsum_bin {
523+
command
524+
} else {
523525
let usage = translate!("hashsum-usage-specific", "utility_name" => binary_name);
524-
command = command
526+
command
525527
.help_template(uucore::localized_help_template(binary_name))
526-
.override_usage(format_usage(&usage));
527-
}
528+
.override_usage(format_usage(&usage))
529+
};
528530

529531
(command, is_hashsum_bin)
530532
}

0 commit comments

Comments
 (0)