From 059ed25a3eea97f370c190803318d5cb7885e1a9 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Mon, 16 Mar 2020 11:47:52 +0200 Subject: Fix crate display name dashes --- crates/ra_project_model/src/lib.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'crates/ra_project_model/src') diff --git a/crates/ra_project_model/src/lib.rs b/crates/ra_project_model/src/lib.rs index a6274709d..897874813 100644 --- a/crates/ra_project_model/src/lib.rs +++ b/crates/ra_project_model/src/lib.rs @@ -245,7 +245,10 @@ impl ProjectWorkspace { let crate_id = crate_graph.add_crate_root( file_id, Edition::Edition2018, - Some(krate.name(&sysroot).to_string()), + Some( + CrateName::new(krate.name(&sysroot)) + .expect("Sysroot crate names should not contain dashes"), + ), cfg_options, env, extern_source, @@ -296,7 +299,7 @@ impl ProjectWorkspace { let crate_id = crate_graph.add_crate_root( file_id, edition, - Some(pkg.name(&cargo).to_string()), + Some(CrateName::normalize_dashes(pkg.name(&cargo))), cfg_options, env, extern_source, -- cgit v1.2.3