mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 21:35:20 +00:00
generalize boilerplate
This commit is contained in:
parent
1a5f32fcb5
commit
90215eb5a0
3 changed files with 51 additions and 39 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue