From 745a619657943f2491a02020907c2de18163b0cd Mon Sep 17 00:00:00 2001 From: Philipp Hansch Date: Mon, 5 Nov 2018 07:11:25 +0100 Subject: [PATCH] Fix dogfood --- clippy_dev/src/main.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/clippy_dev/src/main.rs b/clippy_dev/src/main.rs index 901f59679fe7..bfd98968c422 100644 --- a/clippy_dev/src/main.rs +++ b/clippy_dev/src/main.rs @@ -48,9 +48,9 @@ fn main() { if matches.is_present("print-only") { print_lints(); } else if matches.is_present("check") { - update_lints(UpdateMode::Check); + update_lints(&UpdateMode::Check); } else { - update_lints(UpdateMode::Change); + update_lints(&UpdateMode::Change); } } } @@ -75,7 +75,7 @@ fn print_lints() { println!("there are {} lints", lint_count); } -fn update_lints(update_mode: UpdateMode) { +fn update_lints(update_mode: &UpdateMode) { let lint_list: Vec = gather_all().collect(); let usable_lints: Vec = Lint::usable_lints(lint_list.clone().into_iter()).collect(); let lint_count = usable_lints.len(); @@ -85,7 +85,7 @@ fn update_lints(update_mode: UpdateMode) { r#"\[There are \d+ lints included in this crate!\]\(https://rust-lang-nursery.github.io/rust-clippy/master/index.html\)"#, "", true, - update_mode == UpdateMode::Change, + update_mode == &UpdateMode::Change, || { vec![ format!("[There are {} lints included in this crate!](https://rust-lang-nursery.github.io/rust-clippy/master/index.html)", lint_count) @@ -98,7 +98,7 @@ fn update_lints(update_mode: UpdateMode) { "", "", false, - update_mode == UpdateMode::Change, + update_mode == &UpdateMode::Change, || { gen_changelog_lint_list(lint_list.clone()) } ).changed; @@ -107,7 +107,7 @@ fn update_lints(update_mode: UpdateMode) { "begin deprecated lints", "end deprecated lints", false, - update_mode == UpdateMode::Change, + update_mode == &UpdateMode::Change, || { gen_deprecated(&lint_list) } ).changed; @@ -116,7 +116,7 @@ fn update_lints(update_mode: UpdateMode) { "begin lints modules", "end lints modules", false, - update_mode == UpdateMode::Change, + update_mode == &UpdateMode::Change, || { gen_modules_list(lint_list.clone()) } ).changed; @@ -126,7 +126,7 @@ fn update_lints(update_mode: UpdateMode) { r#"reg.register_lint_group\("clippy::all""#, r#"\]\);"#, false, - update_mode == UpdateMode::Change, + update_mode == &UpdateMode::Change, || { // clippy::all should only include the following lint groups: let all_group_lints = usable_lints.clone().into_iter().filter(|l| { @@ -147,12 +147,12 @@ fn update_lints(update_mode: UpdateMode) { &format!("reg.register_lint_group\\(\"clippy::{}\"", lint_group), r#"\]\);"#, false, - update_mode == UpdateMode::Change, + update_mode == &UpdateMode::Change, || { gen_lint_group_list(lints.clone()) } ).changed; } - if update_mode == UpdateMode::Check && file_change { + if update_mode == &UpdateMode::Check && file_change { println!("Not all lints defined properly. Please run `util/dev update_lints` to make sure all lints are defined properly."); std::process::exit(1); }