1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 12:07:46 +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 = { 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"