diff options
author | Aleksey Kladov <[email protected]> | 2020-06-05 14:07:30 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-06-05 14:07:30 +0100 |
commit | bba374bab2ee53643a899e7ea459b4ab27663bd0 (patch) | |
tree | 77610cd5b460dba0c350a5a9504b813bb3e8be98 /crates/ra_hir_def | |
parent | e63c00f100e960f7b72997026b4b2cd3cd29774b (diff) |
More direct signature for resolve_path
Diffstat (limited to 'crates/ra_hir_def')
-rw-r--r-- | crates/ra_hir_def/src/nameres/mod_resolution.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir_def/src/test_db.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_hir_def/src/nameres/mod_resolution.rs b/crates/ra_hir_def/src/nameres/mod_resolution.rs index 7af922c21..cede4a6fc 100644 --- a/crates/ra_hir_def/src/nameres/mod_resolution.rs +++ b/crates/ra_hir_def/src/nameres/mod_resolution.rs | |||
@@ -61,7 +61,7 @@ impl ModDir { | |||
61 | }; | 61 | }; |
62 | 62 | ||
63 | for candidate in candidate_files.iter() { | 63 | for candidate in candidate_files.iter() { |
64 | if let Some(file_id) = db.resolve_path(file_id, candidate) { | 64 | if let Some(file_id) = db.resolve_path(file_id, candidate.as_str()) { |
65 | let mut root_non_dir_owner = false; | 65 | let mut root_non_dir_owner = false; |
66 | let mut mod_path = RelativePathBuf::new(); | 66 | let mut mod_path = RelativePathBuf::new(); |
67 | if !(candidate.ends_with("mod.rs") || attr_path.is_some()) { | 67 | if !(candidate.ends_with("mod.rs") || attr_path.is_some()) { |
diff --git a/crates/ra_hir_def/src/test_db.rs b/crates/ra_hir_def/src/test_db.rs index d33b57c93..e7a5182f0 100644 --- a/crates/ra_hir_def/src/test_db.rs +++ b/crates/ra_hir_def/src/test_db.rs | |||
@@ -58,8 +58,8 @@ impl FileLoader for TestDB { | |||
58 | fn file_text(&self, file_id: FileId) -> Arc<String> { | 58 | fn file_text(&self, file_id: FileId) -> Arc<String> { |
59 | FileLoaderDelegate(self).file_text(file_id) | 59 | FileLoaderDelegate(self).file_text(file_id) |
60 | } | 60 | } |
61 | fn resolve_path(&self, anchor: FileId, relative_path: &RelativePath) -> Option<FileId> { | 61 | fn resolve_path(&self, anchor: FileId, path: &str) -> Option<FileId> { |
62 | FileLoaderDelegate(self).resolve_path(anchor, relative_path) | 62 | FileLoaderDelegate(self).resolve_path(anchor, path) |
63 | } | 63 | } |
64 | fn relevant_crates(&self, file_id: FileId) -> Arc<Vec<CrateId>> { | 64 | fn relevant_crates(&self, file_id: FileId) -> Arc<Vec<CrateId>> { |
65 | FileLoaderDelegate(self).relevant_crates(file_id) | 65 | FileLoaderDelegate(self).relevant_crates(file_id) |