aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_project_model/src
diff options
context:
space:
mode:
authorEdwin Cheng <[email protected]>2020-03-21 17:09:38 +0000
committerEdwin Cheng <[email protected]>2020-03-21 17:09:38 +0000
commitd62dd63256315a037260f81a98283110511696f1 (patch)
tree54110d4e4898b2e49732029bf957e67d90522d30 /crates/ra_project_model/src
parent50c6a315ab2bef493b618742989744fb370a32ca (diff)
Use target-name for crate-name
Diffstat (limited to 'crates/ra_project_model/src')
-rw-r--r--crates/ra_project_model/src/lib.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_project_model/src/lib.rs b/crates/ra_project_model/src/lib.rs
index b500a74fb..a3ef9acdc 100644
--- a/crates/ra_project_model/src/lib.rs
+++ b/crates/ra_project_model/src/lib.rs
@@ -336,7 +336,7 @@ impl ProjectWorkspace {
336 extern_source, 336 extern_source,
337 ); 337 );
338 if cargo[tgt].kind == TargetKind::Lib { 338 if cargo[tgt].kind == TargetKind::Lib {
339 lib_tgt = Some(crate_id); 339 lib_tgt = Some((crate_id, cargo[tgt].name.clone()));
340 pkg_to_lib_crate.insert(pkg, crate_id); 340 pkg_to_lib_crate.insert(pkg, crate_id);
341 } 341 }
342 if cargo[tgt].is_proc_macro { 342 if cargo[tgt].is_proc_macro {
@@ -363,7 +363,7 @@ impl ProjectWorkspace {
363 363
364 // Set deps to the core, std and to the lib target of the current package 364 // Set deps to the core, std and to the lib target of the current package
365 for &from in pkg_crates.get(&pkg).into_iter().flatten() { 365 for &from in pkg_crates.get(&pkg).into_iter().flatten() {
366 if let Some(to) = lib_tgt { 366 if let Some((to, name)) = lib_tgt.clone() {
367 if to != from 367 if to != from
368 && crate_graph 368 && crate_graph
369 .add_dep( 369 .add_dep(
@@ -371,7 +371,7 @@ impl ProjectWorkspace {
371 // For root projects with dashes in their name, 371 // For root projects with dashes in their name,
372 // cargo metadata does not do any normalization, 372 // cargo metadata does not do any normalization,
373 // so we do it ourselves currently 373 // so we do it ourselves currently
374 CrateName::normalize_dashes(&cargo[pkg].name), 374 CrateName::normalize_dashes(&name),
375 to, 375 to,
376 ) 376 )
377 .is_err() 377 .is_err()