Skip to content

Commit

Permalink
Fix dogfood
Browse files Browse the repository at this point in the history
  • Loading branch information
phansch committed Nov 5, 2018
1 parent 5b24f23 commit 745a619
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions clippy_dev/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand All @@ -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<Lint> = gather_all().collect();
let usable_lints: Vec<Lint> = Lint::usable_lints(lint_list.clone().into_iter()).collect();
let lint_count = usable_lints.len();
Expand All @@ -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)
Expand All @@ -98,7 +98,7 @@ fn update_lints(update_mode: UpdateMode) {
"<!-- begin autogenerated links to lint list -->",
"<!-- end autogenerated links to lint list -->",
false,
update_mode == UpdateMode::Change,
update_mode == &UpdateMode::Change,
|| { gen_changelog_lint_list(lint_list.clone()) }
).changed;

Expand All @@ -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;

Expand All @@ -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;

Expand All @@ -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| {
Expand All @@ -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);
}
Expand Down

0 comments on commit 745a619

Please sign in to comment.