summaryrefslogtreecommitdiff
path: root/cli/mainrt.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-05-08 22:45:06 -0400
committerGitHub <noreply@github.com>2024-05-08 22:45:06 -0400
commit47f7bed677a6b72e873712de8f3988ea891710e4 (patch)
tree096549459b479cf1383e65c87b77e9f9482df258 /cli/mainrt.rs
parente6dc4dfbff25e77d2127591802229b4a74037d24 (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/mainrt.rs')
-rw-r--r--cli/mainrt.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/cli/mainrt.rs b/cli/mainrt.rs
index 59efa026c..6a363c04b 100644
--- a/cli/mainrt.rs
+++ b/cli/mainrt.rs
@@ -36,6 +36,7 @@ use std::env::current_exe;
use crate::args::Flags;
+#[allow(clippy::print_stderr)]
pub(crate) fn unstable_exit_cb(feature: &str, api_name: &str) {
eprintln!(
"Unstable API '{api_name}'. The `--unstable-{}` flag must be provided.",
@@ -44,6 +45,7 @@ pub(crate) fn unstable_exit_cb(feature: &str, api_name: &str) {
std::process::exit(70);
}
+#[allow(clippy::print_stderr)]
fn exit_with_message(message: &str, code: i32) -> ! {
eprintln!(
"{}: {}",
@@ -57,7 +59,7 @@ fn unwrap_or_exit<T>(result: Result<T, AnyError>) -> T {
match result {
Ok(value) => value,
Err(error) => {
- let mut error_string = format!("{error:?}");
+ let mut error_string = format!("{:?}", error);
if let Some(e) = error.downcast_ref::<JsError>() {
error_string = format_js_error(e);