From 9719ce9fc731a400c9744ba1a6569e978c1a97e7 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sat, 13 Mar 2021 17:55:50 +0100 Subject: Use chalk_ir::FnDefId --- crates/hir/src/lib.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'crates/hir') diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index f15fb1a82..7f8f936d3 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs @@ -1715,10 +1715,7 @@ impl Type { } pub fn as_callable(&self, db: &dyn HirDatabase) -> Option { - let def = match self.ty.value.interned(&Interner) { - &TyKind::FnDef(def, _) => Some(def), - _ => None, - }; + let def = self.ty.value.callable_def(db); let sig = self.ty.value.callable_sig(db)?; Some(Callable { ty: self.clone(), sig, def, is_bound_method: false }) -- cgit v1.2.3