aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-12-07 17:48:35 +0000
committerAleksey Kladov <[email protected]>2019-12-07 18:44:43 +0000
commit1692f07393dba4f5c122df1a609d5b18751bf406 (patch)
tree8df8763aabe4ac55f93edbb3d8eed609826a6243 /crates/ra_hir/src
parentdda9587e75f4fd1740d16531038023ff582ef43f (diff)
ToNav for GenericParam
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r--crates/ra_hir/src/code_model.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs
index 29ace8479..8833750c8 100644
--- a/crates/ra_hir/src/code_model.rs
+++ b/crates/ra_hir/src/code_model.rs
@@ -860,6 +860,13 @@ pub struct GenericParam {
860 pub(crate) id: GenericParamId, 860 pub(crate) id: GenericParamId,
861} 861}
862 862
863impl GenericParam {
864 pub fn name(self, db: &impl HirDatabase) -> Name {
865 let params = db.generic_params(self.id.parent);
866 params.params[self.id.local_id].name.clone()
867 }
868}
869
863#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] 870#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
864pub struct ImplBlock { 871pub struct ImplBlock {
865 pub(crate) id: ImplId, 872 pub(crate) id: ImplId,