diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-03-30 10:57:40 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-03-30 10:57:40 +0100 |
commit | 3901198e87df9c85b4a2e996240ca05c6950900f (patch) | |
tree | 428357ba8fdd248c2299e07db171592e6ebfe907 /crates/ra_hir_ty | |
parent | 78a2678b6d31eb8a0c5eafd0fdf4eea7da5321a3 (diff) | |
parent | 3d73345cdba5a6635f719134d8aef3a419783c2a (diff) |
Merge #3763
3763: Simplify r=matklad a=Veetaha
Co-authored-by: veetaha <[email protected]>
Diffstat (limited to 'crates/ra_hir_ty')
-rw-r--r-- | crates/ra_hir_ty/src/display.rs | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/crates/ra_hir_ty/src/display.rs b/crates/ra_hir_ty/src/display.rs index a6ef44a31..c3d92a268 100644 --- a/crates/ra_hir_ty/src/display.rs +++ b/crates/ra_hir_ty/src/display.rs | |||
@@ -159,20 +159,13 @@ impl HirDisplay for ApplicationTy { | |||
159 | } | 159 | } |
160 | TypeCtor::FnDef(def) => { | 160 | TypeCtor::FnDef(def) => { |
161 | let sig = f.db.callable_item_signature(def).subst(&self.parameters); | 161 | let sig = f.db.callable_item_signature(def).subst(&self.parameters); |
162 | let name = match def { | 162 | match def { |
163 | CallableDef::FunctionId(ff) => f.db.function_data(ff).name.clone(), | 163 | CallableDef::FunctionId(ff) => write!(f, "fn {}", f.db.function_data(ff).name)?, |
164 | CallableDef::StructId(s) => f.db.struct_data(s).name.clone(), | 164 | CallableDef::StructId(s) => write!(f, "{}", f.db.struct_data(s).name)?, |
165 | CallableDef::EnumVariantId(e) => { | 165 | CallableDef::EnumVariantId(e) => { |
166 | let enum_data = f.db.enum_data(e.parent); | 166 | write!(f, "{}", f.db.enum_data(e.parent).variants[e.local_id].name)? |
167 | enum_data.variants[e.local_id].name.clone() | ||
168 | } | 167 | } |
169 | }; | 168 | }; |
170 | match def { | ||
171 | CallableDef::FunctionId(_) => write!(f, "fn {}", name)?, | ||
172 | CallableDef::StructId(_) | CallableDef::EnumVariantId(_) => { | ||
173 | write!(f, "{}", name)? | ||
174 | } | ||
175 | } | ||
176 | if self.parameters.len() > 0 { | 169 | if self.parameters.len() > 0 { |
177 | let generics = generics(f.db.upcast(), def.into()); | 170 | let generics = generics(f.db.upcast(), def.into()); |
178 | let (parent_params, self_param, type_params, _impl_trait_params) = | 171 | let (parent_params, self_param, type_params, _impl_trait_params) = |