diff options
author | Aleksey Kladov <[email protected]> | 2019-01-06 10:45:41 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-06 14:35:29 +0000 |
commit | b37fba7136c0191ae0becb3104d2d5746c50c3f1 (patch) | |
tree | 8d39f019c2d601cd258d261ef09ad38f6d41d1f6 /crates/ra_hir/src | |
parent | 61687b9db67d34bbcce8596496448c0717d98316 (diff) |
make deps cancelable
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r-- | crates/ra_hir/src/code_model_api.rs | 4 | ||||
-rw-r--r-- | crates/ra_hir/src/module/nameres.rs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_hir/src/code_model_api.rs b/crates/ra_hir/src/code_model_api.rs index 2f968d97c..f1e891722 100644 --- a/crates/ra_hir/src/code_model_api.rs +++ b/crates/ra_hir/src/code_model_api.rs | |||
@@ -21,8 +21,8 @@ impl Crate { | |||
21 | pub fn crate_id(&self) -> CrateId { | 21 | pub fn crate_id(&self) -> CrateId { |
22 | self.crate_id | 22 | self.crate_id |
23 | } | 23 | } |
24 | pub fn dependencies(&self, db: &impl HirDatabase) -> Vec<CrateDependency> { | 24 | pub fn dependencies(&self, db: &impl HirDatabase) -> Cancelable<Vec<CrateDependency>> { |
25 | self.dependencies_impl(db) | 25 | Ok(self.dependencies_impl(db)) |
26 | } | 26 | } |
27 | pub fn root_module(&self, db: &impl HirDatabase) -> Cancelable<Option<Module>> { | 27 | pub fn root_module(&self, db: &impl HirDatabase) -> Cancelable<Option<Module>> { |
28 | self.root_module_impl(db) | 28 | self.root_module_impl(db) |
diff --git a/crates/ra_hir/src/module/nameres.rs b/crates/ra_hir/src/module/nameres.rs index cd634e42f..059301b05 100644 --- a/crates/ra_hir/src/module/nameres.rs +++ b/crates/ra_hir/src/module/nameres.rs | |||
@@ -344,7 +344,7 @@ where | |||
344 | if let Some(crate_id) = crate_graph.crate_id_for_crate_root(file_id.as_original_file()) | 344 | if let Some(crate_id) = crate_graph.crate_id_for_crate_root(file_id.as_original_file()) |
345 | { | 345 | { |
346 | let krate = Crate::new(crate_id); | 346 | let krate = Crate::new(crate_id); |
347 | for dep in krate.dependencies(self.db) { | 347 | for dep in krate.dependencies(self.db)? { |
348 | if let Some(module) = dep.krate.root_module(self.db)? { | 348 | if let Some(module) = dep.krate.root_module(self.db)? { |
349 | let def_id = module.def_id; | 349 | let def_id = module.def_id; |
350 | self.add_module_item( | 350 | self.add_module_item( |