1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 03:57:44 +00:00

id: remove unnecessary to_string calls

This commit is contained in:
Daniel Hofstetter 2025-05-11 13:35:43 +02:00
parent f4b16176a0
commit f4b1a97c0a

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"