1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 03:57:44 +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 = {
if state.zflag {
"\0".to_string()
} else {
" ".to_string()
}
};
let delimiter = if state.zflag { "\0" } else { " " };
let line_ending = LineEnding::from_zero_flag(state.zflag);
if state.cflag {
@ -307,7 +301,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
}
})
.collect::<Vec<_>>()
.join(&delimiter),
.join(delimiter),
// NOTE: this is necessary to pass GNU's "tests/id/zero.sh":
if state.zflag && state.user_specified && users.len() > 1 {
"\0"