diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-05-08 22:45:06 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-08 22:45:06 -0400 |
commit | 47f7bed677a6b72e873712de8f3988ea891710e4 (patch) | |
tree | 096549459b479cf1383e65c87b77e9f9482df258 /cli/util | |
parent | e6dc4dfbff25e77d2127591802229b4a74037d24 (diff) |
chore: enable clippy::print_stdout and clippy::print_stderr (#23732)
1. Generally we should prefer to use the `log` crate.
2. I very often accidentally commit `eprintln`s.
When we should use `println` or `eprintln`, it's not too bad to be a bit
more verbose and ignore the lint rule.
Diffstat (limited to 'cli/util')
-rw-r--r-- | cli/util/file_watcher.rs | 4 | ||||
-rw-r--r-- | cli/util/v8.rs | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/cli/util/file_watcher.rs b/cli/util/file_watcher.rs index 50ae7c233..247ae49d8 100644 --- a/cli/util/file_watcher.rs +++ b/cli/util/file_watcher.rs @@ -73,6 +73,7 @@ impl DebouncedReceiver { } } +#[allow(clippy::print_stderr)] async fn error_handler<F>(watch_future: F) -> bool where F: Future<Output = Result<(), AnyError>>, @@ -132,8 +133,9 @@ fn create_print_after_restart_fn( clear_screen: bool, ) -> impl Fn() { move || { + #[allow(clippy::print_stderr)] if clear_screen && std::io::stderr().is_terminal() { - eprint!("{CLEAR_SCREEN}"); + eprint!("{}", CLEAR_SCREEN); } info!( "{} File change detected! Restarting!", diff --git a/cli/util/v8.rs b/cli/util/v8.rs index 63bc495d1..a8ab2c3d0 100644 --- a/cli/util/v8.rs +++ b/cli/util/v8.rs @@ -43,6 +43,8 @@ pub fn init_v8_flags( .into_iter() .skip(1) .collect::<Vec<_>>(); + + #[allow(clippy::print_stderr)] if !unrecognized_v8_flags.is_empty() { for f in unrecognized_v8_flags { eprintln!("error: V8 did not recognize flag '{f}'"); |