From 8f88ead7d65ad9a80fa2535dfce83458efda3a7b Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Mon, 27 Mar 2017 14:51:37 +0200 Subject: [PATCH] Remove some legacy code --- src/main.rs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/main.rs b/src/main.rs index 1ca0d2b92f3..0e25ca9734e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -169,8 +169,6 @@ pub fn main() { return; } - let dep_path = env::current_dir().expect("current dir is not readable").join("target").join("debug").join("deps"); - if let Some("clippy") = std::env::args().nth(1).as_ref().map(AsRef::as_ref) { // this arm is executed on the initial call to `cargo clippy` @@ -207,12 +205,11 @@ pub fn main() { let args = std::env::args().skip(2); if let Some(first) = target.kind.get(0) { if target.kind.len() > 1 || first.ends_with("lib") { - if let Err(code) = process(std::iter::once("--lib".to_owned()).chain(args), &dep_path) { + if let Err(code) = process(std::iter::once("--lib".to_owned()).chain(args)) { std::process::exit(code); } } else if ["bin", "example", "test", "bench"].contains(&&**first) { - if let Err(code) = process(vec![format!("--{}", first), target.name].into_iter().chain(args), - &dep_path) { + if let Err(code) = process(vec![format!("--{}", first), target.name].into_iter().chain(args)) { std::process::exit(code); } } @@ -271,9 +268,8 @@ pub fn main() { } } -fn process(old_args: I, dep_path: P) -> Result<(), i32> - where P: AsRef, - I: Iterator +fn process(old_args: I) -> Result<(), i32> + where I: Iterator { let mut args = vec!["rustc".to_owned()]; @@ -286,8 +282,6 @@ fn process(old_args: I, dep_path: P) -> Result<(), i32> if !found_dashes { args.push("--".to_owned()); } - args.push("-L".to_owned()); - args.push(dep_path.as_ref().to_string_lossy().into_owned()); args.push("-Zno-trans".to_owned()); args.push("--cfg".to_owned()); args.push(r#"feature="cargo-clippy""#.to_owned());