mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Adds a param_idx helper
This commit is contained in:
parent
2dfbec149f
commit
12bf008ab1
2 changed files with 7 additions and 2 deletions
|
@ -992,8 +992,8 @@ impl TypeParam {
|
|||
|
||||
pub fn default(self, db: &dyn HirDatabase) -> Option<Ty> {
|
||||
let params = db.generic_defaults(self.id.parent);
|
||||
let local_idx: u32 = self.id.local_id.into_raw().into();
|
||||
params.get(local_idx as usize).map(|d| d.clone())
|
||||
let local_idx = hir_ty::param_idx(db, self.id)?;
|
||||
params.get(local_idx).map(|d| d.clone())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue