Skip to content

Commit 0f75581

Browse files
committed
Auto merge of #10314 - flip1995:clippy_dev-cli-fix, r=xFrednet
Fix CLI of clippy_dev Clap was updated in rust-lang/rust-clippy#10270, which broke the command line of clippy_dev. This swaps out contains_id, which now returns always true in the places it was used with get_flag. r? `@xFrednet` This should also fix https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/.60cargo.20dev.20setup.20intellij.60.20is.20degraded/near/325770850 changelog: none
2 parents a7fecd6 + fabada0 commit 0f75581

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

clippy_dev/src/main.rs

+14-14
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,22 @@ fn main() {
1111

1212
match matches.subcommand() {
1313
Some(("bless", matches)) => {
14-
bless::bless(matches.contains_id("ignore-timestamp"));
14+
bless::bless(matches.get_flag("ignore-timestamp"));
1515
},
1616
Some(("dogfood", matches)) => {
1717
dogfood::dogfood(
18-
matches.contains_id("fix"),
19-
matches.contains_id("allow-dirty"),
20-
matches.contains_id("allow-staged"),
18+
matches.get_flag("fix"),
19+
matches.get_flag("allow-dirty"),
20+
matches.get_flag("allow-staged"),
2121
);
2222
},
2323
Some(("fmt", matches)) => {
24-
fmt::run(matches.contains_id("check"), matches.contains_id("verbose"));
24+
fmt::run(matches.get_flag("check"), matches.get_flag("verbose"));
2525
},
2626
Some(("update_lints", matches)) => {
27-
if matches.contains_id("print-only") {
27+
if matches.get_flag("print-only") {
2828
update_lints::print_lints();
29-
} else if matches.contains_id("check") {
29+
} else if matches.get_flag("check") {
3030
update_lints::update(update_lints::UpdateMode::Check);
3131
} else {
3232
update_lints::update(update_lints::UpdateMode::Change);
@@ -38,15 +38,15 @@ fn main() {
3838
matches.get_one::<String>("name"),
3939
matches.get_one::<String>("category").map(String::as_str),
4040
matches.get_one::<String>("type").map(String::as_str),
41-
matches.contains_id("msrv"),
41+
matches.get_flag("msrv"),
4242
) {
4343
Ok(_) => update_lints::update(update_lints::UpdateMode::Change),
4444
Err(e) => eprintln!("Unable to create lint: {e}"),
4545
}
4646
},
4747
Some(("setup", sub_command)) => match sub_command.subcommand() {
4848
Some(("intellij", matches)) => {
49-
if matches.contains_id("remove") {
49+
if matches.get_flag("remove") {
5050
setup::intellij::remove_rustc_src();
5151
} else {
5252
setup::intellij::setup_rustc_src(
@@ -57,17 +57,17 @@ fn main() {
5757
}
5858
},
5959
Some(("git-hook", matches)) => {
60-
if matches.contains_id("remove") {
60+
if matches.get_flag("remove") {
6161
setup::git_hook::remove_hook();
6262
} else {
63-
setup::git_hook::install_hook(matches.contains_id("force-override"));
63+
setup::git_hook::install_hook(matches.get_flag("force-override"));
6464
}
6565
},
6666
Some(("vscode-tasks", matches)) => {
67-
if matches.contains_id("remove") {
67+
if matches.get_flag("remove") {
6868
setup::vscode::remove_tasks();
6969
} else {
70-
setup::vscode::install_tasks(matches.contains_id("force-override"));
70+
setup::vscode::install_tasks(matches.get_flag("force-override"));
7171
}
7272
},
7373
_ => {},
@@ -91,7 +91,7 @@ fn main() {
9191
Some(("rename_lint", matches)) => {
9292
let old_name = matches.get_one::<String>("old_name").unwrap();
9393
let new_name = matches.get_one::<String>("new_name").unwrap_or(old_name);
94-
let uplift = matches.contains_id("uplift");
94+
let uplift = matches.get_flag("uplift");
9595
update_lints::rename(old_name, new_name, uplift);
9696
},
9797
Some(("deprecate", matches)) => {

0 commit comments

Comments
 (0)