aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src
diff options
context:
space:
mode:
authorFedor Sakharov <[email protected]>2020-05-14 11:47:36 +0100
committerFedor Sakharov <[email protected]>2020-05-14 11:47:36 +0100
commit12bf008ab12f87b2e6d4805681f5a389d9e2f425 (patch)
treed0e4a40066d1ddbe0d9819a0c300480433bc8a79 /crates/ra_hir/src
parent2dfbec149f6de3fe8e64680521aa6076928b24f9 (diff)
Adds a param_idx helper
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r--crates/ra_hir/src/code_model.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs
index 3936f5aaa..cdbf475b3 100644
--- a/crates/ra_hir/src/code_model.rs
+++ b/crates/ra_hir/src/code_model.rs
@@ -992,8 +992,8 @@ impl TypeParam {
992 992
993 pub fn default(self, db: &dyn HirDatabase) -> Option<Ty> { 993 pub fn default(self, db: &dyn HirDatabase) -> Option<Ty> {
994 let params = db.generic_defaults(self.id.parent); 994 let params = db.generic_defaults(self.id.parent);
995 let local_idx: u32 = self.id.local_id.into_raw().into(); 995 let local_idx = hir_ty::param_idx(db, self.id)?;
996 params.get(local_idx as usize).map(|d| d.clone()) 996 params.get(local_idx).map(|d| d.clone())
997 } 997 }
998} 998}
999 999