diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-09-06 12:23:31 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2019-09-06 12:23:31 +0100 |
commit | 2015e8b4d15c8be6c8fd735b0c08ccbbe24fb934 (patch) | |
tree | 5f5adc8ffd4c29d104e646057f636def67ac2549 /crates/ra_cli | |
parent | 3bdb456d17660f3460bbf2c38315568b2f76aaa5 (diff) | |
parent | 9ae455ea52bf0bc60476fdb3d50d05f5873040c1 (diff) |
Merge #1778
1778: make source_root API more abstract r=matklad a=matklad
bors r+
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_cli')
-rw-r--r-- | crates/ra_cli/src/analysis_bench.rs | 5 |
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 | } |