Skip to content

Commit 05c161c

Browse files
authored
Merge pull request #7914 from cakebaker/id_remove_to_string_calls
id: remove unnecessary `to_string` calls
2 parents f4b1617 + f4b1a97 commit 05c161c

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/uu/id/src/id.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
174174
));
175175
}
176176

177-
let delimiter = {
178-
if state.zflag {
179-
"\0".to_string()
180-
} else {
181-
" ".to_string()
182-
}
183-
};
177+
let delimiter = if state.zflag { "\0" } else { " " };
184178
let line_ending = LineEnding::from_zero_flag(state.zflag);
185179

186180
if state.cflag {
@@ -307,7 +301,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
307301
}
308302
})
309303
.collect::<Vec<_>>()
310-
.join(&delimiter),
304+
.join(delimiter),
311305
// NOTE: this is necessary to pass GNU's "tests/id/zero.sh":
312306
if state.zflag && state.user_specified && users.len() > 1 {
313307
"\0"

0 commit comments

Comments
 (0)