Skip to content

Commit 6f06921

Browse files
committed
fix(desktop): allow clippy::print_stderr at terminal error path in main
WHY: `cargo clippy --workspace --all-targets -- -D warnings` (`just ci`) flagged the bare `eprintln!` in `main.rs:30` introduced when the entry point gained the runtime-init prelude. The terminal error path in a binary is the correct place for stderr output before `process::exit(1)` — same rationale as the CLI's file-level `#![allow(clippy::print_stderr)]` in `crates/cli/src/main.rs`. Inline-scoped `#[allow]` is preferred here because the rest of the file should not silently gain print_stderr suppression. CI was red on all 3 OS jobs of PR #167 with this lone clippy error.
1 parent 78e4bf2 commit 6f06921

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

crates/desktop/src/main.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,13 @@ fn main() {
2727
let _guard = runtime.enter();
2828

2929
if let Err(err) = perima_desktop::run() {
30-
eprintln!("perima-desktop exited with error: {err:#}");
30+
// WHY allow(clippy::print_stderr): this is the terminal error path in a
31+
// binary entry point — writing to stderr before exit is the correct UX.
32+
// The CLI crate suppresses the same lint with the same rationale.
33+
#[allow(clippy::print_stderr)]
34+
{
35+
eprintln!("perima-desktop exited with error: {err:#}");
36+
}
3137
std::process::exit(1);
3238
}
3339
}

0 commit comments

Comments
 (0)