From 9d19e5b962f77259dd1334b9edb4da4de54f0987 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Fri, 2 Oct 2020 21:38:22 +0300 Subject: Properly name the field --- crates/hir_def/src/import_map.rs | 10 +++++----- crates/hir_def/src/nameres.rs | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'crates/hir_def') diff --git a/crates/hir_def/src/import_map.rs b/crates/hir_def/src/import_map.rs index a442fb63a..44bfe1593 100644 --- a/crates/hir_def/src/import_map.rs +++ b/crates/hir_def/src/import_map.rs @@ -334,14 +334,14 @@ mod tests { use super::*; - fn check_search(ra_fixture: &str, krate_name: &str, query: Query, expect: Expect) { + fn check_search(ra_fixture: &str, crate_name: &str, query: Query, expect: Expect) { let db = TestDB::with_files(ra_fixture); let crate_graph = db.crate_graph(); let krate = crate_graph .iter() .find(|krate| { - crate_graph[*krate].display_name.as_ref().map(|n| n.to_string()) - == Some(krate_name.to_string()) + crate_graph[*krate].declaration_name.as_ref().map(|n| n.to_string()) + == Some(crate_name.to_string()) }) .unwrap(); @@ -359,7 +359,7 @@ mod tests { let path = map.path_of(item).unwrap(); format!( "{}::{} ({})\n", - crate_graph[krate].display_name.as_ref().unwrap(), + crate_graph[krate].declaration_name.as_ref().unwrap(), path, mark ) @@ -400,7 +400,7 @@ mod tests { .iter() .filter_map(|krate| { let cdata = &crate_graph[krate]; - let name = cdata.display_name.as_ref()?; + let name = cdata.declaration_name.as_ref()?; let map = db.import_map(krate); diff --git a/crates/hir_def/src/nameres.rs b/crates/hir_def/src/nameres.rs index 5e4d73c1f..464ffef21 100644 --- a/crates/hir_def/src/nameres.rs +++ b/crates/hir_def/src/nameres.rs @@ -173,7 +173,7 @@ 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] - .display_name + .declaration_name .as_ref() .map(ToString::to_string) .unwrap_or_default() -- cgit v1.2.3