diff options
Diffstat (limited to 'crates/rust-analyzer/src/cli/analysis_stats.rs')
-rw-r--r-- | crates/rust-analyzer/src/cli/analysis_stats.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/crates/rust-analyzer/src/cli/analysis_stats.rs b/crates/rust-analyzer/src/cli/analysis_stats.rs index 2f4c29e06..9d09501cd 100644 --- a/crates/rust-analyzer/src/cli/analysis_stats.rs +++ b/crates/rust-analyzer/src/cli/analysis_stats.rs | |||
@@ -1,7 +1,11 @@ | |||
1 | //! Fully type-check project and print various stats, like the number of type | 1 | //! Fully type-check project and print various stats, like the number of type |
2 | //! errors. | 2 | //! errors. |
3 | 3 | ||
4 | use std::{collections::HashSet, path::Path, time::Instant}; | 4 | use std::{path::Path, time::Instant}; |
5 | |||
6 | use itertools::Itertools; | ||
7 | use rand::{seq::SliceRandom, thread_rng}; | ||
8 | use rustc_hash::FxHashSet; | ||
5 | 9 | ||
6 | use hir::{ | 10 | use hir::{ |
7 | db::{AstDatabase, DefDatabase, HirDatabase}, | 11 | db::{AstDatabase, DefDatabase, HirDatabase}, |
@@ -9,10 +13,8 @@ use hir::{ | |||
9 | }; | 13 | }; |
10 | use hir_def::FunctionId; | 14 | use hir_def::FunctionId; |
11 | use hir_ty::{Ty, TypeWalk}; | 15 | use hir_ty::{Ty, TypeWalk}; |
12 | use itertools::Itertools; | ||
13 | use ra_db::SourceDatabaseExt; | 16 | use ra_db::SourceDatabaseExt; |
14 | use ra_syntax::AstNode; | 17 | use ra_syntax::AstNode; |
15 | use rand::{seq::SliceRandom, thread_rng}; | ||
16 | use stdx::format_to; | 18 | use stdx::format_to; |
17 | 19 | ||
18 | use crate::cli::{load_cargo::load_cargo, progress_report::ProgressReport, Result, Verbosity}; | 20 | use crate::cli::{load_cargo::load_cargo, progress_report::ProgressReport, Result, Verbosity}; |
@@ -33,7 +35,7 @@ pub fn analysis_stats( | |||
33 | println!("Database loaded {:?}", db_load_time.elapsed()); | 35 | println!("Database loaded {:?}", db_load_time.elapsed()); |
34 | let analysis_time = Instant::now(); | 36 | let analysis_time = Instant::now(); |
35 | let mut num_crates = 0; | 37 | let mut num_crates = 0; |
36 | let mut visited_modules = HashSet::new(); | 38 | let mut visited_modules = FxHashSet::default(); |
37 | let mut visit_queue = Vec::new(); | 39 | let mut visit_queue = Vec::new(); |
38 | 40 | ||
39 | let mut krates = Crate::all(db); | 41 | let mut krates = Crate::all(db); |