From 9ed04cf89bee3ef0edcb7a08cd961659b23132c9 Mon Sep 17 00:00:00 2001 From: Jiahao XU <Jiahao_XU@outlook.com> Date: Fri, 28 Oct 2022 11:48:16 +1100 Subject: [PATCH] Fix clippy error on unit test CI (#503) Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> --- crates/bin/src/ui.rs | 2 +- crates/binstalk/src/bins.rs | 4 +--- crates/binstalk/src/ops/install.rs | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/crates/bin/src/ui.rs b/crates/bin/src/ui.rs index 345baf1f..715cc7b6 100644 --- a/crates/bin/src/ui.rs +++ b/crates/bin/src/ui.rs @@ -77,7 +77,7 @@ impl UIThreadInner { self.confirm_rx .recv() .await - .unwrap_or_else(|| Err(BinstallError::UserAbort)) + .unwrap_or(Err(BinstallError::UserAbort)) } } diff --git a/crates/binstalk/src/bins.rs b/crates/binstalk/src/bins.rs index 8f93fe67..221cfc59 100644 --- a/crates/binstalk/src/bins.rs +++ b/crates/binstalk/src/bins.rs @@ -121,9 +121,7 @@ impl BinFile { }; // Destination at install dir + base-name{.extension} - let dest = data - .install_path - .join(&ctx.render("{ bin }{ binary-ext }")?); + let dest = data.install_path.join(ctx.render("{ bin }{ binary-ext }")?); let (dest, link) = if no_symlinks { (dest, None) diff --git a/crates/binstalk/src/ops/install.rs b/crates/binstalk/src/ops/install.rs index 6a6c086b..2e1fe3d1 100644 --- a/crates/binstalk/src/ops/install.rs +++ b/crates/binstalk/src/ops/install.rs @@ -132,7 +132,7 @@ async fn install_from_source( cmd.arg("--force"); } - let command_string = format!("{:?}", cmd); + let command_string = format!("{cmd:?}"); let mut child = jobserver_client.configure_and_run(&mut cmd, |cmd| cmd.spawn())?;