Skip to content

Commit 399e023

Browse files
committed
boycott manish
1 parent df2d3c8 commit 399e023

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

src/main.rs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,27 +62,29 @@ where
6262
let mut unstable_options = false;
6363

6464
for arg in old_args.by_ref() {
65-
match arg {
65+
match arg.as_str() {
6666
"--fix" => {
6767
fix = true;
6868
continue;
69-
},
69+
}
7070
"--" => break,
7171
// Cover -Zunstable-options and -Z unstable-options
7272
s if s.ends_with("unstable-options") => unstable_options = true,
73-
_ => {},
73+
_ => {}
7474
}
7575

7676
args.push(arg);
7777
}
7878

79-
if fix && !unstable_options {
80-
panic!("Usage of `--fix` requires `-Z unstable-options`");
81-
} else {
82-
args[0] = "fix".to_owned();
79+
if fix {
80+
if !unstable_options {
81+
panic!("Usage of `--fix` requires `-Z unstable-options`");
82+
} else {
83+
args[0] = "fix".to_owned();
84+
}
8385
}
8486

85-
let env_name = if unstable_options {
87+
let path_env = if unstable_options {
8688
"RUSTC_WORKSPACE_WRAPPER"
8789
} else {
8890
"RUSTC_WRAPPER"
@@ -119,7 +121,7 @@ where
119121

120122
let exit_status = std::process::Command::new("cargo")
121123
.args(&args)
122-
.env("RUSTC_WORKSPACE_WRAPPER", path)
124+
.env(path_env, path)
123125
.env("CLIPPY_ARGS", clippy_args)
124126
.envs(target_dir)
125127
.spawn()

0 commit comments

Comments
 (0)