about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJane Lusby <jlusby@yaah.dev>2020-03-27 13:23:06 -0700
committerJane Lusby <jlusby@yaah.dev>2020-03-27 13:23:06 -0700
commit399e0231cd599e20b43ccb62c4ab2c55a730ded3 (patch)
tree677e444da435408badfe3f7c3ee972e9a4c434ad
parentdf2d3c82df7ed70de7aa0d8db642b4f454228c4d (diff)
downloadrust-399e0231cd599e20b43ccb62c4ab2c55a730ded3.tar.gz
rust-399e0231cd599e20b43ccb62c4ab2c55a730ded3.zip
boycott manish
-rw-r--r--src/main.rs20
1 files 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()