diff options
author | Aleksey Kladov <[email protected]> | 2019-10-24 10:32:19 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-10-24 10:32:19 +0100 |
commit | 5750ee69ff4a131c08d0d9b3298c78b92b566f09 (patch) | |
tree | b8c396b3ec64d3d23f145e57067683568c3c0e72 /crates/ra_cli/src/analysis_stats.rs | |
parent | 018b621f613e87af26d8f7880ea1012cb374216c (diff) |
add --with-deps option to analysis-stats
Diffstat (limited to 'crates/ra_cli/src/analysis_stats.rs')
-rw-r--r-- | crates/ra_cli/src/analysis_stats.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/crates/ra_cli/src/analysis_stats.rs b/crates/ra_cli/src/analysis_stats.rs index cda5cafb8..04aba3743 100644 --- a/crates/ra_cli/src/analysis_stats.rs +++ b/crates/ra_cli/src/analysis_stats.rs | |||
@@ -13,6 +13,7 @@ pub fn run( | |||
13 | memory_usage: bool, | 13 | memory_usage: bool, |
14 | path: &Path, | 14 | path: &Path, |
15 | only: Option<&str>, | 15 | only: Option<&str>, |
16 | with_deps: bool, | ||
16 | ) -> Result<()> { | 17 | ) -> Result<()> { |
17 | let db_load_time = Instant::now(); | 18 | let db_load_time = Instant::now(); |
18 | let (mut host, roots) = ra_batch::load_cargo(path)?; | 19 | let (mut host, roots) = ra_batch::load_cargo(path)?; |
@@ -23,18 +24,17 @@ pub fn run( | |||
23 | let mut visited_modules = HashSet::new(); | 24 | let mut visited_modules = HashSet::new(); |
24 | let mut visit_queue = Vec::new(); | 25 | let mut visit_queue = Vec::new(); |
25 | 26 | ||
26 | let members = roots | 27 | let members = |
27 | .into_iter() | 28 | roots |
28 | .filter_map( | 29 | .into_iter() |
29 | |(source_root_id, project_root)| { | 30 | .filter_map(|(source_root_id, project_root)| { |
30 | if project_root.is_member() { | 31 | if with_deps || project_root.is_member() { |
31 | Some(source_root_id) | 32 | Some(source_root_id) |
32 | } else { | 33 | } else { |
33 | None | 34 | None |
34 | } | 35 | } |
35 | }, | 36 | }) |
36 | ) | 37 | .collect::<HashSet<_>>(); |
37 | .collect::<HashSet<_>>(); | ||
38 | 38 | ||
39 | for krate in Crate::all(db) { | 39 | for krate in Crate::all(db) { |
40 | let module = krate.root_module(db).expect("crate without root module"); | 40 | let module = krate.root_module(db).expect("crate without root module"); |