From 399e0231cd599e20b43ccb62c4ab2c55a730ded3 Mon Sep 17 00:00:00 2001 From: Jane Lusby Date: Fri, 27 Mar 2020 13:23:06 -0700 Subject: [PATCH] boycott manish --- src/main.rs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/main.rs b/src/main.rs index 4749300c3e8..8c4a596cc4d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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" @@ -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()