Skip to content

Commit

Permalink
boycott manish
Browse files Browse the repository at this point in the history
  • Loading branch information
yaahc committed Mar 27, 2020
1 parent df2d3c8 commit 399e023
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,27 +62,29 @@ where
let mut unstable_options = false;

for arg in old_args.by_ref() {
match arg {
match arg.as_str() {
"--fix" => {
fix = true;
continue;
},
}
"--" => break,
// Cover -Zunstable-options and -Z unstable-options
s if s.ends_with("unstable-options") => unstable_options = true,
_ => {},
_ => {}
}

args.push(arg);
}

if fix && !unstable_options {
panic!("Usage of `--fix` requires `-Z unstable-options`");
} else {
args[0] = "fix".to_owned();
if fix {
if !unstable_options {
panic!("Usage of `--fix` requires `-Z unstable-options`");
} else {
args[0] = "fix".to_owned();
}
}

let env_name = if unstable_options {
let path_env = if unstable_options {
"RUSTC_WORKSPACE_WRAPPER"
} else {
"RUSTC_WRAPPER"
Expand Down Expand Up @@ -119,7 +121,7 @@ where

let exit_status = std::process::Command::new("cargo")
.args(&args)
.env("RUSTC_WORKSPACE_WRAPPER", path)
.env(path_env, path)
.env("CLIPPY_ARGS", clippy_args)
.envs(target_dir)
.spawn()
Expand Down

0 comments on commit 399e023

Please sign in to comment.