diff options
author | Aleksey Kladov <[email protected]> | 2019-12-07 17:48:35 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-12-07 18:44:43 +0000 |
commit | 1692f07393dba4f5c122df1a609d5b18751bf406 (patch) | |
tree | 8df8763aabe4ac55f93edbb3d8eed609826a6243 /crates/ra_hir | |
parent | dda9587e75f4fd1740d16531038023ff582ef43f (diff) |
ToNav for GenericParam
Diffstat (limited to 'crates/ra_hir')
-rw-r--r-- | crates/ra_hir/src/code_model.rs | 7 |
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 | ||
863 | impl 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)] |
864 | pub struct ImplBlock { | 871 | pub struct ImplBlock { |
865 | pub(crate) id: ImplId, | 872 | pub(crate) id: ImplId, |