diff options
Diffstat (limited to 'crates/ra_hir')
-rw-r--r-- | crates/ra_hir/src/code_model.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 78c444037..a53c4961e 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs | |||
@@ -54,8 +54,7 @@ pub struct CrateDependency { | |||
54 | 54 | ||
55 | impl Crate { | 55 | impl Crate { |
56 | pub fn dependencies(self, db: &impl DefDatabase) -> Vec<CrateDependency> { | 56 | pub fn dependencies(self, db: &impl DefDatabase) -> Vec<CrateDependency> { |
57 | db.crate_graph() | 57 | db.crate_graph()[self.id] |
58 | .crate_data(&self.id) | ||
59 | .dependencies | 58 | .dependencies |
60 | .iter() | 59 | .iter() |
61 | .map(|dep| { | 60 | .map(|dep| { |
@@ -72,7 +71,7 @@ impl Crate { | |||
72 | crate_graph | 71 | crate_graph |
73 | .iter() | 72 | .iter() |
74 | .filter(|&krate| { | 73 | .filter(|&krate| { |
75 | crate_graph.crate_data(&krate).dependencies.iter().any(|it| it.crate_id == self.id) | 74 | crate_graph[krate].dependencies.iter().any(|it| it.crate_id == self.id) |
76 | }) | 75 | }) |
77 | .map(|id| Crate { id }) | 76 | .map(|id| Crate { id }) |
78 | .collect() | 77 | .collect() |
@@ -84,11 +83,11 @@ impl Crate { | |||
84 | } | 83 | } |
85 | 84 | ||
86 | pub fn root_file(self, db: &impl DefDatabase) -> FileId { | 85 | pub fn root_file(self, db: &impl DefDatabase) -> FileId { |
87 | db.crate_graph().crate_data(&self.id).root_file_id | 86 | db.crate_graph()[self.id].root_file_id |
88 | } | 87 | } |
89 | 88 | ||
90 | pub fn edition(self, db: &impl DefDatabase) -> Edition { | 89 | pub fn edition(self, db: &impl DefDatabase) -> Edition { |
91 | db.crate_graph().crate_data(&self.id).edition | 90 | db.crate_graph()[self.id].edition |
92 | } | 91 | } |
93 | 92 | ||
94 | pub fn all(db: &impl DefDatabase) -> Vec<Crate> { | 93 | pub fn all(db: &impl DefDatabase) -> Vec<Crate> { |