aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir
diff options
context:
space:
mode:
authorFedor Sakharov <[email protected]>2020-05-14 07:56:20 +0100
committerFedor Sakharov <[email protected]>2020-05-14 07:56:20 +0100
commita55ad203888b5e43cf6cbf015d562d7bd1abe0bb (patch)
treeeda6928064d68ca69053de327ee74148ce8a64c0 /crates/ra_hir
parent00f3b6c59ae3df9a7bfb1cd8b694d5f9b6a78be4 (diff)
Use generic_defaults and display_source_code
Diffstat (limited to 'crates/ra_hir')
-rw-r--r--crates/ra_hir/src/code_model.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs
index 3c56f39c1..3936f5aaa 100644
--- a/crates/ra_hir/src/code_model.rs
+++ b/crates/ra_hir/src/code_model.rs
@@ -990,9 +990,10 @@ impl TypeParam {
990 } 990 }
991 } 991 }
992 992
993 pub fn default(self, db: &dyn HirDatabase) -> Option<TypeRef> { 993 pub fn default(self, db: &dyn HirDatabase) -> Option<Ty> {
994 let params = db.generic_params(self.id.parent); 994 let params = db.generic_defaults(self.id.parent);
995 params.types[self.id.local_id].default.clone() 995 let local_idx: u32 = self.id.local_id.into_raw().into();
996 params.get(local_idx as usize).map(|d| d.clone())
996 } 997 }
997} 998}
998 999