Bump which to version 4 removing failure dependency (#55)

We are now completely free of failure dependencies!
This commit is contained in:
James McMurray
2020-06-18 07:56:37 +02:00
committed by GitHub
parent 460752adfa
commit 3ca2e01f1f
3 changed files with 40 additions and 79 deletions

View File

@@ -6,7 +6,6 @@ pub use chroot::chroot;
pub use mount::mount;
pub use qemu::qemu;
use anyhow::anyhow;
use std::path::PathBuf;
use std::process::Command;
use which::which;
@@ -18,16 +17,7 @@ pub struct Tool {
impl Tool {
pub fn find(name: &'static str) -> anyhow::Result<Self> {
// Note this conversion is only necessary until which releases their new version using
// thiserror instead of failure - then we can just use .with_context() on the thiserror
// Error
// Commit pending release:
// BLOCKED: https://github.com/harryfei/which-rs/commit/e6e839c4f6cdf8d3e33ec7eafdd50d34472740ea
let which = match which(name) {
Ok(x) => Ok(x),
Err(_) => Err(anyhow!("Could not find tool: {}", name)),
}?;
Ok(Self { exec: which })
Ok(Self { exec: which(name)? })
}
pub fn execute(&self) -> Command {