generalize boilerplate

This commit is contained in:
Aleksey Kladov 2019-01-25 00:02:18 +03:00
parent 1a5f32fcb5
commit 90215eb5a0
3 changed files with 51 additions and 39 deletions

View file

@ -30,10 +30,6 @@ impl Function {
db.body_hir(*self)
}
pub(crate) fn module(&self, db: &impl HirDatabase) -> Module {
self.id.loc(db).module
}
/// The containing impl block, if this is a method.
pub(crate) fn impl_block(&self, db: &impl HirDatabase) -> Option<ImplBlock> {
let module_impls = db.impls_in_module(self.module(db));