diff options
Diffstat (limited to 'crates/ra_hir/src/code_model_impl')
-rw-r--r-- | crates/ra_hir/src/code_model_impl/krate.rs | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/crates/ra_hir/src/code_model_impl/krate.rs b/crates/ra_hir/src/code_model_impl/krate.rs deleted file mode 100644 index 914414fc3..000000000 --- a/crates/ra_hir/src/code_model_impl/krate.rs +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | use crate::{ | ||
2 | Crate, CrateDependency, AsName, Module, DefDatabase, | ||
3 | }; | ||
4 | |||
5 | impl Crate { | ||
6 | pub(crate) fn dependencies_impl(&self, db: &impl DefDatabase) -> Vec<CrateDependency> { | ||
7 | let crate_graph = db.crate_graph(); | ||
8 | crate_graph | ||
9 | .dependencies(self.crate_id) | ||
10 | .map(|dep| { | ||
11 | let krate = Crate { crate_id: dep.crate_id() }; | ||
12 | let name = dep.as_name(); | ||
13 | CrateDependency { krate, name } | ||
14 | }) | ||
15 | .collect() | ||
16 | } | ||
17 | pub(crate) fn root_module_impl(&self, db: &impl DefDatabase) -> Option<Module> { | ||
18 | let module_id = db.crate_def_map(*self).root(); | ||
19 | let module = Module { krate: *self, module_id }; | ||
20 | Some(module) | ||
21 | } | ||
22 | } | ||