Skip to content

Commit

Permalink
Clippy fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Morganamilo committed Dec 9, 2021
1 parent a3c74d8 commit 0b2effe
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
5 changes: 1 addition & 4 deletions src/chroot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<Vec<_>>();
let mut args = chroot_flags.iter().map(OsStr::new).collect::<Vec<_>>();
args.push(OsStr::new("-r"));
args.push(OsStr::new(self.path.as_os_str()));

Expand Down
4 changes: 2 additions & 2 deletions src/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ fn command_status<C: AsRef<OsStr>, S: AsRef<OsStr>, P: AsRef<Path>>(
.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);

Expand Down Expand Up @@ -136,7 +136,7 @@ pub fn command_output<C: AsRef<OsStr>, S: AsRef<OsStr>, P: AsRef<Path>>(
.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) {
Expand Down
4 changes: 2 additions & 2 deletions src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -850,7 +850,7 @@ fn review<'a>(config: &Config, actions: &Actions<'a>) -> Result<i32> {
"{} {} {}",
tr!("failed to run:"),
config.bat_bin,
file.path().display().to_string()
file.path().display()
)
})?;
let _ = stdin.write_all(&output.stdout);
Expand Down

0 comments on commit 0b2effe

Please sign in to comment.