aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_project_model
diff options
context:
space:
mode:
authorKirill Bulatov <[email protected]>2020-03-16 09:47:52 +0000
committerKirill Bulatov <[email protected]>2020-03-16 09:47:52 +0000
commit059ed25a3eea97f370c190803318d5cb7885e1a9 (patch)
tree7c4b36fc3623683380caf5bd6487e3f8aa57774a /crates/ra_project_model
parent6bc226fa1918b8025b19cdf9d1f972f029e6a899 (diff)
Fix crate display name dashes
Diffstat (limited to 'crates/ra_project_model')
-rw-r--r--crates/ra_project_model/src/lib.rs7
1 files changed, 5 insertions, 2 deletions
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 {
245 let crate_id = crate_graph.add_crate_root( 245 let crate_id = crate_graph.add_crate_root(
246 file_id, 246 file_id,
247 Edition::Edition2018, 247 Edition::Edition2018,
248 Some(krate.name(&sysroot).to_string()), 248 Some(
249 CrateName::new(krate.name(&sysroot))
250 .expect("Sysroot crate names should not contain dashes"),
251 ),
249 cfg_options, 252 cfg_options,
250 env, 253 env,
251 extern_source, 254 extern_source,
@@ -296,7 +299,7 @@ impl ProjectWorkspace {
296 let crate_id = crate_graph.add_crate_root( 299 let crate_id = crate_graph.add_crate_root(
297 file_id, 300 file_id,
298 edition, 301 edition,
299 Some(pkg.name(&cargo).to_string()), 302 Some(CrateName::normalize_dashes(pkg.name(&cargo))),
300 cfg_options, 303 cfg_options,
301 env, 304 env,
302 extern_source, 305 extern_source,