diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-01-30 19:37:48 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-01-30 19:37:48 +0000 |
commit | c65e6cdcb3d603ce7c0943785f7140662022c54a (patch) | |
tree | b92e52aed2a5b22d73cbebccd08f2870c8212b16 /crates/ra_hir/src/source_binder.rs | |
parent | b704ce803b99f0c69bbcd3d4ab531d2604de8594 (diff) | |
parent | ef7eb8c2576963a9a2df405feff354d36366b202 (diff) |
Merge #709
709: Use Crate instead of CrateId r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/source_binder.rs')
-rw-r--r-- | crates/ra_hir/src/source_binder.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/ra_hir/src/source_binder.rs b/crates/ra_hir/src/source_binder.rs index 589efd023..d1eaccf23 100644 --- a/crates/ra_hir/src/source_binder.rs +++ b/crates/ra_hir/src/source_binder.rs | |||
@@ -14,7 +14,7 @@ use ra_syntax::{ | |||
14 | 14 | ||
15 | use crate::{ | 15 | use crate::{ |
16 | HirDatabase, Function, ModuleDef, Struct, Enum, | 16 | HirDatabase, Function, ModuleDef, Struct, Enum, |
17 | AsName, Module, HirFileId, | 17 | AsName, Module, HirFileId, Crate, |
18 | ids::{LocationCtx, SourceFileItemId}, | 18 | ids::{LocationCtx, SourceFileItemId}, |
19 | }; | 19 | }; |
20 | 20 | ||
@@ -83,7 +83,8 @@ fn module_from_source( | |||
83 | let source_root_id = db.file_source_root(file_id.as_original_file()); | 83 | let source_root_id = db.file_source_root(file_id.as_original_file()); |
84 | db.source_root_crates(source_root_id) | 84 | db.source_root_crates(source_root_id) |
85 | .iter() | 85 | .iter() |
86 | .find_map(|&krate| { | 86 | .map(|&crate_id| Crate { crate_id }) |
87 | .find_map(|krate| { | ||
87 | let module_tree = db.module_tree(krate); | 88 | let module_tree = db.module_tree(krate); |
88 | let module_id = module_tree.find_module_by_source(file_id, decl_id)?; | 89 | let module_id = module_tree.find_module_by_source(file_id, decl_id)?; |
89 | Some(Module { krate, module_id }) | 90 | Some(Module { krate, module_id }) |