Skip to content

Commit 62d489c

Browse files
committed
style: enable clippy::print_std(err|out) when applicable
1 parent cfffde5 commit 62d489c

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

src/cli/rustup_mode.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,8 @@ pub async fn main(
588588
}
589589

590590
let Some(subcmd) = matches.subcmd else {
591-
eprintln!("{}", Rustup::command().render_long_help());
591+
let help = Rustup::command().render_long_help();
592+
writeln!(process.stderr().lock(), "{help}")?;
592593
return Ok(utils::ExitCode(1));
593594
};
594595

src/diskio/threaded.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ impl<'a> Executor for Threaded<'a> {
268268
prev_files as u64,
269269
));
270270
}
271+
#[allow(clippy::print_stderr)]
271272
if prev_files > 50 {
272273
eprintln!("{prev_files} deferred IO operations");
273274
}

src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
clippy::result_large_err, // 288 bytes is our 'large' variant today, which is unlikely to be a performance problem
44
clippy::arc_with_non_send_sync, // will get resolved as we move further into async
55
)]
6+
#![cfg_attr(not(test), warn(
7+
// We use the logging system instead of printing directly.
8+
clippy::print_stdout,
9+
clippy::print_stderr,
10+
))]
611
#![recursion_limit = "1024"]
712

813
use anyhow::{anyhow, Result};

src/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![allow(clippy::box_default)]
1+
#![allow(clippy::box_default, clippy::print_stdout, clippy::print_stderr)]
22
//! Test support module; public to permit use from integration tests.
33
44
pub mod mock;

0 commit comments

Comments
 (0)