Skip to content

Commit e2a6764

Browse files
committed
Adress review comments
1 parent fc00cdc commit e2a6764

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

lintcheck/src/config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ pub(crate) struct LintcheckConfig {
1313
value_name = "N",
1414
default_value_t = 0,
1515
default_value_if("perf", "true", Some("1")), // Limit jobs to 1 when benchmarking
16+
conflicts_with("perf"),
1617
required = false,
1718
hide_default_value = true
1819
)]

lintcheck/src/main.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ impl Crate {
131131
"--",
132132
"cargo",
133133
]);
134-
cmd.env("CARGO_PROFILE_RELEASE_DEBUG", "true");
135134
} else {
136135
cmd = Command::new("cargo");
137136
}
@@ -254,17 +253,25 @@ fn normalize_diag(
254253

255254
/// Builds clippy inside the repo to make sure we have a clippy executable we can use.
256255
fn build_clippy(release_build: bool) -> String {
257-
let output = Command::new("cargo")
256+
let mut build_cmd = Command::new("cargo");
257+
build_cmd
258258
.args([
259259
"run",
260260
"--bin=clippy-driver",
261261
if release_build { "-r" } else { "" },
262262
"--",
263263
"--version",
264-
])
264+
]);
265+
266+
if release_build {
267+
build_cmd.env("CARGO_PROFILE_RELEASE_DEBUG", "true");
268+
}
269+
270+
let output = build_cmd
265271
.stderr(Stdio::inherit())
266272
.output()
267273
.unwrap();
274+
268275
if !output.status.success() {
269276
eprintln!("Error: Failed to compile Clippy!");
270277
std::process::exit(1);
@@ -286,13 +293,6 @@ fn main() {
286293

287294
let config = LintcheckConfig::new();
288295

289-
if config.perf && config.max_jobs != 1 {
290-
eprintln!(
291-
"Lintcheck's --perf flag must be triggered only with 1 job,\nremove either the --jobs/-j flag or the --perf flag"
292-
);
293-
return;
294-
}
295-
296296
match config.subcommand {
297297
Some(Commands::Diff { old, new, truncate }) => json::diff(&old, &new, truncate),
298298
Some(Commands::Popular { output, number }) => popular_crates::fetch(output, number).unwrap(),

0 commit comments

Comments
 (0)