aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_cli
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-09-05 20:36:04 +0100
committerAleksey Kladov <[email protected]>2019-09-06 12:21:11 +0100
commit9ae455ea52bf0bc60476fdb3d50d05f5873040c1 (patch)
tree5f5adc8ffd4c29d104e646057f636def67ac2549 /crates/ra_cli
parent3bdb456d17660f3460bbf2c38315568b2f76aaa5 (diff)
make source_root API more abstract
Diffstat (limited to 'crates/ra_cli')
-rw-r--r--crates/ra_cli/src/analysis_bench.rs5
1 files changed, 3 insertions, 2 deletions
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<()> {
34 .iter() 34 .iter()
35 .find_map(|(source_root_id, project_root)| { 35 .find_map(|(source_root_id, project_root)| {
36 if project_root.is_member() { 36 if project_root.is_member() {
37 for (rel_path, file_id) in &db.source_root(*source_root_id).files { 37 for file_id in db.source_root(*source_root_id).walk() {
38 let rel_path = db.file_relative_path(file_id);
38 let abs_path = rel_path.to_path(project_root.path()); 39 let abs_path = rel_path.to_path(project_root.path());
39 if abs_path == path { 40 if abs_path == path {
40 return Some(*file_id); 41 return Some(file_id);
41 } 42 }
42 } 43 }
43 } 44 }