From 9ae455ea52bf0bc60476fdb3d50d05f5873040c1 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 5 Sep 2019 22:36:04 +0300 Subject: make source_root API more abstract --- crates/ra_cli/src/analysis_bench.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'crates/ra_cli') diff --git a/crates/ra_cli/src/analysis_bench.rs b/crates/ra_cli/src/analysis_bench.rs index 9e76bcebf..01b96ec58 100644 --- a/crates/ra_cli/src/analysis_bench.rs +++ b/crates/ra_cli/src/analysis_bench.rs @@ -34,10 +34,11 @@ pub(crate) fn run(verbose: bool, path: &Path, op: Op) -> Result<()> { .iter() .find_map(|(source_root_id, project_root)| { if project_root.is_member() { - for (rel_path, file_id) in &db.source_root(*source_root_id).files { + for file_id in db.source_root(*source_root_id).walk() { + let rel_path = db.file_relative_path(file_id); let abs_path = rel_path.to_path(project_root.path()); if abs_path == path { - return Some(*file_id); + return Some(file_id); } } } -- cgit v1.2.3