1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-30 04:27:45 +00:00

Merge pull request #7914 from cakebaker/id_remove_to_string_calls

id: remove unnecessary `to_string` calls
This commit is contained in:
Sylvestre Ledru 2025-05-11 14:28:57 +02:00 committed by GitHub
commit 05c161cbb5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -174,13 +174,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
)); ));
} }
let delimiter = { let delimiter = if state.zflag { "\0" } else { " " };
if state.zflag {
"\0".to_string()
} else {
" ".to_string()
}
};
let line_ending = LineEnding::from_zero_flag(state.zflag); let line_ending = LineEnding::from_zero_flag(state.zflag);
if state.cflag { if state.cflag {
@ -307,7 +301,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
} }
}) })
.collect::<Vec<_>>() .collect::<Vec<_>>()
.join(&delimiter), .join(delimiter),
// NOTE: this is necessary to pass GNU's "tests/id/zero.sh": // NOTE: this is necessary to pass GNU's "tests/id/zero.sh":
if state.zflag && state.user_specified && users.len() > 1 { if state.zflag && state.user_specified && users.len() > 1 {
"\0" "\0"