mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-27 05:23:24 +00:00
Minor
This commit is contained in:
parent
28332d9b63
commit
14ea21617a
2 changed files with 4 additions and 5 deletions
|
@ -778,8 +778,7 @@ impl GenericDef {
|
|||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
|
||||
pub struct Local {
|
||||
// TODO: ID,
|
||||
pub(crate) parent: DefWithBody,
|
||||
pub(crate) parent: DefWithBodyId,
|
||||
pub(crate) pat_id: PatId,
|
||||
}
|
||||
|
||||
|
@ -808,11 +807,11 @@ impl Local {
|
|||
}
|
||||
|
||||
pub fn parent(self, _db: &impl HirDatabase) -> DefWithBody {
|
||||
self.parent
|
||||
self.parent.into()
|
||||
}
|
||||
|
||||
pub fn module(self, db: &impl HirDatabase) -> Module {
|
||||
self.parent.module(db)
|
||||
self.parent(db).module(db)
|
||||
}
|
||||
|
||||
pub fn ty(self, db: &impl HirDatabase) -> Type {
|
||||
|
|
|
@ -225,6 +225,6 @@ impl From<AssocItem> for GenericDefId {
|
|||
|
||||
impl From<(DefWithBodyId, PatId)> for Local {
|
||||
fn from((parent, pat_id): (DefWithBodyId, PatId)) -> Self {
|
||||
Local { parent: parent.into(), pat_id }
|
||||
Local { parent, pat_id }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue