From af4e75533f2c071330e740e2fa94b131e3a2b538 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 20 Oct 2020 15:38:11 +0200 Subject: Rename declaration_name -> display_name Declaration names sounds like a name of declaration -- something you can use for analysis. It empathically isn't, and is just a label displayed in various UI. It's important not to confuse the two, least we accidentally mix semantics with UI (I believe, there's already a case of this in the FamousDefs at least). --- crates/hir_def/src/nameres.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'crates/hir_def/src/nameres.rs') diff --git a/crates/hir_def/src/nameres.rs b/crates/hir_def/src/nameres.rs index 464ffef21..3d04f81c6 100644 --- a/crates/hir_def/src/nameres.rs +++ b/crates/hir_def/src/nameres.rs @@ -172,11 +172,7 @@ pub struct ModuleData { impl CrateDefMap { pub(crate) fn crate_def_map_query(db: &dyn DefDatabase, krate: CrateId) -> Arc { let _p = profile::span("crate_def_map_query").detail(|| { - db.crate_graph()[krate] - .declaration_name - .as_ref() - .map(ToString::to_string) - .unwrap_or_default() + db.crate_graph()[krate].display_name.as_deref().unwrap_or_default().to_string() }); let def_map = { let edition = db.crate_graph()[krate].edition; -- cgit v1.2.3