diff options
author | Aleksey Kladov <[email protected]> | 2020-02-29 17:34:34 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-02-29 17:34:34 +0000 |
commit | 14ea21617ab510daa4f88b0f7c93fdfd2d36e42d (patch) | |
tree | 991bdd051484f063169545124f5e006dcd0f491f /crates | |
parent | 28332d9b63ed58ecc33604d04488f07ff75a553d (diff) |
Minor
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_hir/src/code_model.rs | 7 | ||||
-rw-r--r-- | crates/ra_hir/src/from_id.rs | 2 |
2 files changed, 4 insertions, 5 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index a9615a3b7..034fb7cfa 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs | |||
@@ -778,8 +778,7 @@ impl GenericDef { | |||
778 | 778 | ||
779 | #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] | 779 | #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] |
780 | pub struct Local { | 780 | pub struct Local { |
781 | // TODO: ID, | 781 | pub(crate) parent: DefWithBodyId, |
782 | pub(crate) parent: DefWithBody, | ||
783 | pub(crate) pat_id: PatId, | 782 | pub(crate) pat_id: PatId, |
784 | } | 783 | } |
785 | 784 | ||
@@ -808,11 +807,11 @@ impl Local { | |||
808 | } | 807 | } |
809 | 808 | ||
810 | pub fn parent(self, _db: &impl HirDatabase) -> DefWithBody { | 809 | pub fn parent(self, _db: &impl HirDatabase) -> DefWithBody { |
811 | self.parent | 810 | self.parent.into() |
812 | } | 811 | } |
813 | 812 | ||
814 | pub fn module(self, db: &impl HirDatabase) -> Module { | 813 | pub fn module(self, db: &impl HirDatabase) -> Module { |
815 | self.parent.module(db) | 814 | self.parent(db).module(db) |
816 | } | 815 | } |
817 | 816 | ||
818 | pub fn ty(self, db: &impl HirDatabase) -> Type { | 817 | pub fn ty(self, db: &impl HirDatabase) -> Type { |
diff --git a/crates/ra_hir/src/from_id.rs b/crates/ra_hir/src/from_id.rs index 88540fbf2..cbfa91d6c 100644 --- a/crates/ra_hir/src/from_id.rs +++ b/crates/ra_hir/src/from_id.rs | |||
@@ -225,6 +225,6 @@ impl From<AssocItem> for GenericDefId { | |||
225 | 225 | ||
226 | impl From<(DefWithBodyId, PatId)> for Local { | 226 | impl From<(DefWithBodyId, PatId)> for Local { |
227 | fn from((parent, pat_id): (DefWithBodyId, PatId)) -> Self { | 227 | fn from((parent, pat_id): (DefWithBodyId, PatId)) -> Self { |
228 | Local { parent: parent.into(), pat_id } | 228 | Local { parent, pat_id } |
229 | } | 229 | } |
230 | } | 230 | } |