mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
ToNav for GenericParam
This commit is contained in:
parent
dda9587e75
commit
1692f07393
2 changed files with 28 additions and 1 deletions
|
@ -860,6 +860,13 @@ pub struct GenericParam {
|
|||
pub(crate) id: GenericParamId,
|
||||
}
|
||||
|
||||
impl GenericParam {
|
||||
pub fn name(self, db: &impl HirDatabase) -> Name {
|
||||
let params = db.generic_params(self.id.parent);
|
||||
params.params[self.id.local_id].name.clone()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
pub struct ImplBlock {
|
||||
pub(crate) id: ImplId,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue