Return impl Iterator instead of Vec<Lint>

This makes the API of `lib.rs` a bit more flexible.
This commit is contained in:
Philipp Hansch
2018-09-05 13:34:28 +02:00
parent be995dc0e8
commit 79bec036f8
2 changed files with 15 additions and 15 deletions

View File

@@ -27,7 +27,7 @@ fn main() {
}
fn print_lints() {
let lint_list = collect_all();
let lint_list = gather_all().collect::<Vec<Lint>>();
let grouped_by_lint_group = Lint::by_lint_group(&lint_list);
for (lint_group, mut lints) in grouped_by_lint_group {
@@ -41,5 +41,5 @@ fn print_lints() {
}
}
println!("there are {} lints", Lint::active_lints(&lint_list).len());
println!("there are {} lints", Lint::active_lints(&lint_list).count());
}