Skip to content

Commit 497ea56

Browse files
committed
refactor(uucore): format cfg_attr and variable assignment for readability
- Condensed multi-line cfg_attr into a single line in early_stdout_state mod - Split long variable assignment across lines in bin macro for better readability This improves code consistency and readability without changing functionality.
1 parent b0004a0 commit 497ea56

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/uucore/src/lib/lib.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,7 @@ mod early_stdout_state {
230230
}
231231

232232
#[used]
233-
#[cfg_attr(
234-
target_os = "macos",
235-
unsafe(link_section = "__DATA,__mod_init_func")
236-
)]
233+
#[cfg_attr(target_os = "macos", unsafe(link_section = "__DATA,__mod_init_func"))]
237234
#[cfg_attr(not(target_os = "macos"), unsafe(link_section = ".init_array"))]
238235
static INIT: extern "C" fn() = init;
239236
}
@@ -360,8 +357,8 @@ macro_rules! bin {
360357
// Treat write errors as a failure, but ignore BrokenPipe to avoid
361358
// breaking utilities that intentionally silence it (e.g., seq).
362359
let stdout_was_written = uucore::stdout_was_written();
363-
let ignore_closed_stdout = uucore::is_closed_stdout_error(&e, stdout_was_closed)
364-
&& !stdout_was_written;
360+
let ignore_closed_stdout =
361+
uucore::is_closed_stdout_error(&e, stdout_was_closed) && !stdout_was_written;
365362
if e.kind() != std::io::ErrorKind::BrokenPipe && !ignore_closed_stdout {
366363
eprintln!("Error flushing stdout: {e}");
367364
if code == 0 {

0 commit comments

Comments
 (0)