From 5750ee69ff4a131c08d0d9b3298c78b92b566f09 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 24 Oct 2019 12:32:19 +0300 Subject: add --with-deps option to analysis-stats --- crates/ra_cli/src/analysis_stats.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'crates/ra_cli/src/analysis_stats.rs') 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( memory_usage: bool, path: &Path, only: Option<&str>, + with_deps: bool, ) -> Result<()> { let db_load_time = Instant::now(); let (mut host, roots) = ra_batch::load_cargo(path)?; @@ -23,18 +24,17 @@ pub fn run( let mut visited_modules = HashSet::new(); let mut visit_queue = Vec::new(); - let members = roots - .into_iter() - .filter_map( - |(source_root_id, project_root)| { - if project_root.is_member() { + let members = + roots + .into_iter() + .filter_map(|(source_root_id, project_root)| { + if with_deps || project_root.is_member() { Some(source_root_id) } else { None } - }, - ) - .collect::>(); + }) + .collect::>(); for krate in Crate::all(db) { let module = krate.root_module(db).expect("crate without root module"); -- cgit v1.2.3