mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Use generic_defaults and display_source_code
This commit is contained in:
parent
00f3b6c59a
commit
a55ad20388
4 changed files with 16 additions and 14 deletions
|
@ -990,9 +990,10 @@ impl TypeParam {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn default(self, db: &dyn HirDatabase) -> Option<TypeRef> {
|
||||
let params = db.generic_params(self.id.parent);
|
||||
params.types[self.id.local_id].default.clone()
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue