From 012fec54dc508896493d5d3073b4786c93d66fe9 Mon Sep 17 00:00:00 2001 From: Muhammad Mominul Huque Date: Mon, 8 Jul 2019 03:29:38 +0600 Subject: Constify KnownName's --- crates/ra_hir/src/generics.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'crates/ra_hir/src/generics.rs') diff --git a/crates/ra_hir/src/generics.rs b/crates/ra_hir/src/generics.rs index 521e47090..3ad2c551a 100644 --- a/crates/ra_hir/src/generics.rs +++ b/crates/ra_hir/src/generics.rs @@ -9,6 +9,7 @@ use ra_syntax::ast::{self, DefaultTypeParamOwner, NameOwner, TypeBoundsOwner, Ty use crate::{ db::{AstDatabase, DefDatabase, HirDatabase}, + name::SELF_TYPE, path::Path, type_ref::TypeRef, AdtDef, AsName, Container, Enum, EnumVariant, Function, HasSource, ImplBlock, Name, Struct, @@ -83,7 +84,7 @@ impl GenericParams { // traits get the Self type as an implicit first type parameter generics.params.push(GenericParam { idx: start, - name: Name::self_type(), + name: SELF_TYPE, default: None, }); generics.fill(&*it.source(db).ast, start + 1); -- cgit v1.2.3 From 09b72489dd085dadce94b454408d18a36abb1681 Mon Sep 17 00:00:00 2001 From: Muhammad Mominul Huque Date: Mon, 8 Jul 2019 04:09:35 +0600 Subject: cargo format --- crates/ra_hir/src/generics.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'crates/ra_hir/src/generics.rs') diff --git a/crates/ra_hir/src/generics.rs b/crates/ra_hir/src/generics.rs index 3ad2c551a..07a59193f 100644 --- a/crates/ra_hir/src/generics.rs +++ b/crates/ra_hir/src/generics.rs @@ -82,11 +82,7 @@ impl GenericParams { GenericDef::Enum(it) => generics.fill(&*it.source(db).ast, start), GenericDef::Trait(it) => { // traits get the Self type as an implicit first type parameter - generics.params.push(GenericParam { - idx: start, - name: SELF_TYPE, - default: None, - }); + generics.params.push(GenericParam { idx: start, name: SELF_TYPE, default: None }); generics.fill(&*it.source(db).ast, start + 1); } GenericDef::TypeAlias(it) => generics.fill(&*it.source(db).ast, start), -- cgit v1.2.3