From 0b2effed4101169d63a6a5fa47d6f4f88c25b287 Mon Sep 17 00:00:00 2001 From: morganamilo Date: Thu, 9 Dec 2021 19:40:27 +0000 Subject: [PATCH] Clippy fix --- src/chroot.rs | 5 +---- src/exec.rs | 4 ++-- src/install.rs | 4 ++-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/chroot.rs b/src/chroot.rs index bc9f6b58..0f85bb68 100644 --- a/src/chroot.rs +++ b/src/chroot.rs @@ -91,10 +91,7 @@ impl Chroot { } pub fn build(&self, pkgbuild: &Path, chroot_flags: &[&str], flags: &[&str]) -> Result<()> { - let mut args = chroot_flags - .iter() - .map(|f| OsStr::new(f)) - .collect::>(); + let mut args = chroot_flags.iter().map(OsStr::new).collect::>(); args.push(OsStr::new("-r")); args.push(OsStr::new(self.path.as_os_str())); diff --git a/src/exec.rs b/src/exec.rs index 0d21c7c1..de4bfe5e 100644 --- a/src/exec.rs +++ b/src/exec.rs @@ -102,7 +102,7 @@ fn command_status, S: AsRef, P: AsRef>( .args(args) .status() .map(|s| Status(s.code().unwrap_or(1))) - .with_context(|| command_err(cmd.as_ref(), args.as_ref())); + .with_context(|| command_err(cmd.as_ref(), args)); DEFAULT_SIGNALS.store(true, Ordering::Relaxed); @@ -136,7 +136,7 @@ pub fn command_output, S: AsRef, P: AsRef>( .current_dir(dir) .args(args) .output() - .with_context(|| command_err(cmd.as_ref(), args.as_ref())); + .with_context(|| command_err(cmd.as_ref(), args)); DEFAULT_SIGNALS.store(true, Ordering::Relaxed); let ret = match term.swap(0, Ordering::Relaxed) { diff --git a/src/install.rs b/src/install.rs index d62b8d88..3f22dcbd 100644 --- a/src/install.rs +++ b/src/install.rs @@ -552,7 +552,7 @@ async fn prepare_build( let srcinfos = download_pkgbuilds(config, &bases).await?; if let Some(ref cmd) = config.pre_build_command { - let args = [&"-c", cmd.as_str()]; + let args = ["-c", cmd.as_str()]; for base in &bases.bases { let dir = config.fetch.clone_dir.join(base.package_base()); @@ -850,7 +850,7 @@ fn review<'a>(config: &Config, actions: &Actions<'a>) -> Result { "{} {} {}", tr!("failed to run:"), config.bat_bin, - file.path().display().to_string() + file.path().display() ) })?; let _ = stdin.write_all(&output.stdout);