diff options
Diffstat (limited to 'crates/ra_hir/src/code_model_impl/function.rs')
-rw-r--r-- | crates/ra_hir/src/code_model_impl/function.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/ra_hir/src/code_model_impl/function.rs b/crates/ra_hir/src/code_model_impl/function.rs index 8d6b7fc19..66d7e1713 100644 --- a/crates/ra_hir/src/code_model_impl/function.rs +++ b/crates/ra_hir/src/code_model_impl/function.rs | |||
@@ -2,7 +2,6 @@ mod scope; | |||
2 | 2 | ||
3 | use std::sync::Arc; | 3 | use std::sync::Arc; |
4 | 4 | ||
5 | use ra_db::Cancelable; | ||
6 | use ra_syntax::{TreeArc, ast::{self, NameOwner}}; | 5 | use ra_syntax::{TreeArc, ast::{self, NameOwner}}; |
7 | 6 | ||
8 | use crate::{ | 7 | use crate::{ |
@@ -20,16 +19,16 @@ impl Function { | |||
20 | Function { def_id } | 19 | Function { def_id } |
21 | } | 20 | } |
22 | 21 | ||
23 | pub(crate) fn body(&self, db: &impl HirDatabase) -> Cancelable<Arc<Body>> { | 22 | pub(crate) fn body(&self, db: &impl HirDatabase) -> Arc<Body> { |
24 | db.body_hir(self.def_id) | 23 | db.body_hir(self.def_id) |
25 | } | 24 | } |
26 | 25 | ||
27 | pub(crate) fn module(&self, db: &impl HirDatabase) -> Cancelable<Module> { | 26 | pub(crate) fn module(&self, db: &impl HirDatabase) -> Module { |
28 | self.def_id.module(db) | 27 | self.def_id.module(db) |
29 | } | 28 | } |
30 | 29 | ||
31 | /// The containing impl block, if this is a method. | 30 | /// The containing impl block, if this is a method. |
32 | pub(crate) fn impl_block(&self, db: &impl HirDatabase) -> Cancelable<Option<ImplBlock>> { | 31 | pub(crate) fn impl_block(&self, db: &impl HirDatabase) -> Option<ImplBlock> { |
33 | self.def_id.impl_block(db) | 32 | self.def_id.impl_block(db) |
34 | } | 33 | } |
35 | } | 34 | } |