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/tools/upgrade.rs | |
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/tools/upgrade.rs')
-rw-r--r-- | cli/tools/upgrade.rs | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/cli/tools/upgrade.rs b/cli/tools/upgrade.rs index 6bb4606d3..073ebdc1c 100644 --- a/cli/tools/upgrade.rs +++ b/cli/tools/upgrade.rs @@ -274,23 +274,17 @@ pub fn check_for_upgrades( if let Some(upgrade_version) = update_checker.should_prompt() { if log::log_enabled!(log::Level::Info) && std::io::stderr().is_terminal() { if version::is_canary() { - eprint!( - "{} ", - colors::green("A new canary release of Deno is available.") - ); - eprintln!( - "{}", + log::info!( + "{} {}", + colors::green("A new canary release of Deno is available."), colors::italic_gray("Run `deno upgrade --canary` to install it.") ); } else { - eprint!( - "{} {} → {} ", + log::info!( + "{} {} → {} {}", colors::green("A new release of Deno is available:"), colors::cyan(version::deno()), - colors::cyan(&upgrade_version) - ); - eprintln!( - "{}", + colors::cyan(&upgrade_version), colors::italic_gray("Run `deno upgrade` to install it.") ); } |