aboutsummaryrefslogtreecommitdiff
path: root/crates/project_model/src/cargo_workspace.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/project_model/src/cargo_workspace.rs')
-rw-r--r--crates/project_model/src/cargo_workspace.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/crates/project_model/src/cargo_workspace.rs b/crates/project_model/src/cargo_workspace.rs
index 1d8d34a0b..f7241b711 100644
--- a/crates/project_model/src/cargo_workspace.rs
+++ b/crates/project_model/src/cargo_workspace.rs
@@ -1,5 +1,6 @@
1//! FIXME: write short doc here 1//! FIXME: write short doc here
2 2
3use std::path::PathBuf;
3use std::{convert::TryInto, ops, process::Command, sync::Arc}; 4use std::{convert::TryInto, ops, process::Command, sync::Arc};
4 5
5use anyhow::{Context, Result}; 6use anyhow::{Context, Result};
@@ -249,11 +250,12 @@ impl CargoWorkspace {
249 let edition = edition 250 let edition = edition
250 .parse::<Edition>() 251 .parse::<Edition>()
251 .with_context(|| format!("Failed to parse edition {}", edition))?; 252 .with_context(|| format!("Failed to parse edition {}", edition))?;
253
252 let pkg = packages.alloc(PackageData { 254 let pkg = packages.alloc(PackageData {
253 id: id.repr.clone(), 255 id: id.repr.clone(),
254 name: name.clone(), 256 name: name.clone(),
255 version: version.to_string(), 257 version: version.to_string(),
256 manifest: AbsPathBuf::assert(manifest_path.clone()), 258 manifest: AbsPathBuf::assert(PathBuf::from(&manifest_path)),
257 targets: Vec::new(), 259 targets: Vec::new(),
258 is_member, 260 is_member,
259 edition, 261 edition,
@@ -268,7 +270,7 @@ impl CargoWorkspace {
268 let tgt = targets.alloc(TargetData { 270 let tgt = targets.alloc(TargetData {
269 package: pkg, 271 package: pkg,
270 name: meta_tgt.name.clone(), 272 name: meta_tgt.name.clone(),
271 root: AbsPathBuf::assert(meta_tgt.src_path.clone()), 273 root: AbsPathBuf::assert(PathBuf::from(&meta_tgt.src_path)),
272 kind: TargetKind::new(meta_tgt.kind.as_slice()), 274 kind: TargetKind::new(meta_tgt.kind.as_slice()),
273 is_proc_macro, 275 is_proc_macro,
274 }); 276 });
@@ -305,7 +307,8 @@ impl CargoWorkspace {
305 packages[source].active_features.extend(node.features); 307 packages[source].active_features.extend(node.features);
306 } 308 }
307 309
308 let workspace_root = AbsPathBuf::assert(meta.workspace_root); 310 let workspace_root =
311 AbsPathBuf::assert(PathBuf::from(meta.workspace_root.into_os_string()));
309 let build_data_config = BuildDataConfig::new( 312 let build_data_config = BuildDataConfig::new(
310 cargo_toml.to_path_buf(), 313 cargo_toml.to_path_buf(),
311 config.clone(), 314 config.clone(),