diff --git a/clippy_dev/Cargo.toml b/clippy_dev/Cargo.toml index de56e4b05c91..e2e946d06f27 100644 --- a/clippy_dev/Cargo.toml +++ b/clippy_dev/Cargo.toml @@ -11,5 +11,3 @@ regex = "1" lazy_static = "1.0" shell-escape = "0.1" walkdir = "2" -# FIXME: remove this once cargo issue #7475 is fixed -home = "0.5" diff --git a/clippy_dev/src/fmt.rs b/clippy_dev/src/fmt.rs index 3c90aa4b5075..69cd046a855e 100644 --- a/clippy_dev/src/fmt.rs +++ b/clippy_dev/src/fmt.rs @@ -137,13 +137,13 @@ fn cargo_fmt(context: &FmtContext, path: &Path) -> Result { args.push("--"); args.push("--check"); } - let success = exec(context, &bin_path("cargo"), path, &args)?; + let success = exec(context, "cargo", path, &args)?; Ok(success) } fn rustfmt_test(context: &FmtContext) -> Result<(), CliError> { - let program = bin_path("rustfmt"); + let program = "rustfmt"; let dir = std::env::current_dir()?; let args = &["+nightly", "--version"]; @@ -170,7 +170,7 @@ fn rustfmt(context: &FmtContext, path: &Path) -> Result { if context.check { args.push("--check".as_ref()); } - let success = exec(context, &bin_path("rustfmt"), std::env::current_dir()?, &args)?; + let success = exec(context, "rustfmt", std::env::current_dir()?, &args)?; if !success { eprintln!("rustfmt failed on {}", path.display()); } @@ -195,12 +195,3 @@ fn project_root() -> Result { Err(CliError::ProjectRootNotFound) } - -// Workaround for https://github.com/rust-lang/cargo/issues/7475. -// FIXME: replace `&bin_path("command")` with `"command"` once the issue is fixed -fn bin_path(bin: &str) -> String { - let mut p = home::cargo_home().unwrap(); - p.push("bin"); - p.push(bin); - p.display().to_string() -}