diff options
author | Aleksey Kladov <[email protected]> | 2019-12-07 19:09:53 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-12-07 19:25:48 +0000 |
commit | 88c5b1282a5770097c6c768b24bedfc3a6944e08 (patch) | |
tree | 913c24e889f3db8044b4b9f11bc3969e7eb02e34 /crates/ra_hir/src/from_source.rs | |
parent | f4f8b8147426b0096d4b5126e487caaa13d13c27 (diff) |
Rename GenericParam -> TypeParam
We don't have LifetimeParam yet, but they are planned!
Diffstat (limited to 'crates/ra_hir/src/from_source.rs')
-rw-r--r-- | crates/ra_hir/src/from_source.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_hir/src/from_source.rs b/crates/ra_hir/src/from_source.rs index 686ab1d79..68e59fc1e 100644 --- a/crates/ra_hir/src/from_source.rs +++ b/crates/ra_hir/src/from_source.rs | |||
@@ -11,8 +11,8 @@ use ra_syntax::{ | |||
11 | 11 | ||
12 | use crate::{ | 12 | use crate::{ |
13 | db::{AstDatabase, DefDatabase, HirDatabase}, | 13 | db::{AstDatabase, DefDatabase, HirDatabase}, |
14 | Const, DefWithBody, Enum, EnumVariant, FieldSource, Function, GenericParam, ImplBlock, InFile, | 14 | Const, DefWithBody, Enum, EnumVariant, FieldSource, Function, ImplBlock, InFile, Local, |
15 | Local, MacroDef, Module, Static, Struct, StructField, Trait, TypeAlias, Union, | 15 | MacroDef, Module, Static, Struct, StructField, Trait, TypeAlias, TypeParam, Union, |
16 | }; | 16 | }; |
17 | 17 | ||
18 | pub trait FromSource: Sized { | 18 | pub trait FromSource: Sized { |
@@ -177,7 +177,7 @@ impl Local { | |||
177 | } | 177 | } |
178 | } | 178 | } |
179 | 179 | ||
180 | impl GenericParam { | 180 | impl TypeParam { |
181 | pub fn from_source(db: &impl HirDatabase, src: InFile<ast::TypeParam>) -> Option<Self> { | 181 | pub fn from_source(db: &impl HirDatabase, src: InFile<ast::TypeParam>) -> Option<Self> { |
182 | let file_id = src.file_id; | 182 | let file_id = src.file_id; |
183 | let parent: GenericDefId = src.value.syntax().ancestors().find_map(|it| { | 183 | let parent: GenericDefId = src.value.syntax().ancestors().find_map(|it| { |
@@ -190,7 +190,7 @@ impl GenericParam { | |||
190 | Some(res) | 190 | Some(res) |
191 | })?; | 191 | })?; |
192 | let &id = parent.child_by_source(db)[keys::TYPE_PARAM].get(&src)?; | 192 | let &id = parent.child_by_source(db)[keys::TYPE_PARAM].get(&src)?; |
193 | Some(GenericParam { id }) | 193 | Some(TypeParam { id }) |
194 | } | 194 | } |
195 | } | 195 | } |
196 | 196 | ||