aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty
diff options
context:
space:
mode:
authorFedor Sakharov <[email protected]>2020-05-14 11:47:36 +0100
committerFedor Sakharov <[email protected]>2020-05-14 11:47:36 +0100
commit12bf008ab12f87b2e6d4805681f5a389d9e2f425 (patch)
treed0e4a40066d1ddbe0d9819a0c300480433bc8a79 /crates/ra_hir_ty
parent2dfbec149f6de3fe8e64680521aa6076928b24f9 (diff)
Adds a param_idx helper
Diffstat (limited to 'crates/ra_hir_ty')
-rw-r--r--crates/ra_hir_ty/src/lib.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/crates/ra_hir_ty/src/lib.rs b/crates/ra_hir_ty/src/lib.rs
index e8f3482fe..ccc4348f4 100644
--- a/crates/ra_hir_ty/src/lib.rs
+++ b/crates/ra_hir_ty/src/lib.rs
@@ -427,6 +427,11 @@ impl Substs {
427 } 427 }
428} 428}
429 429
430/// Return an index of a parameter in the generic type parameter list by it's id.
431pub fn param_idx(db: &dyn HirDatabase, id: TypeParamId) -> Option<usize> {
432 generics(db.upcast(), id.parent).param_idx(id)
433}
434
430#[derive(Debug, Clone)] 435#[derive(Debug, Clone)]
431pub struct SubstsBuilder { 436pub struct SubstsBuilder {
432 vec: Vec<Ty>, 437 vec: Vec<Ty>,