Skip to content

Commit

Permalink
Apply Clippy suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
rami3l committed May 4, 2024
1 parent 65a7851 commit 4609d1a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/cli/download_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ impl DownloadTracker {
let percent = (self.total_downloaded as f64 / content_len as f64) * 100.;
let remaining = content_len - self.total_downloaded;
let eta_h = Duration::from_secs(if speed == 0 {
std::u64::MAX
u64::MAX
} else {
(remaining / speed) as u64
});
Expand Down
4 changes: 2 additions & 2 deletions src/cli/rustup_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1176,7 +1176,7 @@ fn show(cfg: &Cfg, m: &ArgMatches) -> Result<utils::ExitCode> {
)?;
writeln!(t.lock(), "name: {}", active_toolchain.name())?;
writeln!(t.lock(), "compiler: {}", active_toolchain.rustc_version())?;
writeln!(t.lock(), "active because: {}", active_reason.to_string())?;
writeln!(t.lock(), "active because: {}", active_reason)?;

// show installed targets for the active toolchain
writeln!(t.lock(), "installed targets:")?;
Expand Down Expand Up @@ -1214,7 +1214,7 @@ fn show_active_toolchain(cfg: &Cfg, m: &ArgMatches) -> Result<utils::ExitCode> {
let cwd = utils::current_dir()?;
match cfg.find_active_toolchain(&cwd)? {
Some((toolchain_name, reason)) => {
let toolchain = new_toolchain_with_reason(cfg, toolchain_name.clone().into(), &reason)?;
let toolchain = new_toolchain_with_reason(cfg, toolchain_name.clone(), &reason)?;
writeln!(
process().stdout().lock(),
"{}\nactive because: {}",
Expand Down
4 changes: 2 additions & 2 deletions tests/suite/cli_rustup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2158,7 +2158,7 @@ fn override_order() {
// env > dir override > file > default
let out = config.run(
"rustup",
&["show", "active-toolchain"],
["show", "active-toolchain"],
&[("RUSTUP_TOOLCHAIN", env_tc)],
);
assert!(out.ok);
Expand All @@ -2167,7 +2167,7 @@ fn override_order() {
// +toolchain > env > dir override > file > default
let out = config.run(
"rustup",
&[&format!("+{}", command_tc), "show", "active-toolchain"],
[&format!("+{}", command_tc), "show", "active-toolchain"],
&[("RUSTUP_TOOLCHAIN", env_tc)],
);
assert!(out.ok);
Expand Down

0 comments on commit 4609d1a

Please sign in to comment.