Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-def/src/lib.rs')
| -rw-r--r-- | crates/hir-def/src/lib.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/hir-def/src/lib.rs b/crates/hir-def/src/lib.rs index 36afd8f8a5..ba6f67fcbb 100644 --- a/crates/hir-def/src/lib.rs +++ b/crates/hir-def/src/lib.rs @@ -724,12 +724,12 @@ impl From<EnumVariantId> for DefWithBodyId { } impl DefWithBodyId { - pub fn as_generic_def_id(self, db: &dyn DefDatabase) -> Option<GenericDefId> { + pub fn generic_def(self, db: &dyn DefDatabase) -> GenericDefId { match self { - DefWithBodyId::FunctionId(f) => Some(f.into()), - DefWithBodyId::StaticId(s) => Some(s.into()), - DefWithBodyId::ConstId(c) => Some(c.into()), - DefWithBodyId::VariantId(c) => Some(c.lookup(db).parent.into()), + DefWithBodyId::FunctionId(f) => f.into(), + DefWithBodyId::StaticId(s) => s.into(), + DefWithBodyId::ConstId(c) => c.into(), + DefWithBodyId::VariantId(c) => c.lookup(db).parent.into(), } } } |