Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir/src/has_source.rs')
| -rw-r--r-- | crates/hir/src/has_source.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/hir/src/has_source.rs b/crates/hir/src/has_source.rs index 31cf8ba336..d10884517f 100644 --- a/crates/hir/src/has_source.rs +++ b/crates/hir/src/has_source.rs @@ -116,7 +116,7 @@ impl HasSource for Enum { impl HasSource for Variant { type Ast = ast::Variant; fn source(self, db: &dyn HirDatabase) -> Option<InFile<ast::Variant>> { - Some(self.parent.id.child_source(db.upcast()).map(|map| map[self.id].clone())) + Some(self.id.lookup(db.upcast()).source(db.upcast())) } } impl HasSource for Function { |