From ebc3bcab0ae055eaaaf07dbeddf4a78150b1afea Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Thu, 13 Aug 2020 21:23:43 +0100 Subject: [PATCH] Fix ManifestPath compiler errors --- src/crate_metadata.rs | 2 +- src/workspace/manifest.rs | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/crate_metadata.rs b/src/crate_metadata.rs index cc312e3e..82469dfc 100644 --- a/src/crate_metadata.rs +++ b/src/crate_metadata.rs @@ -95,7 +95,7 @@ impl CrateMetadata { fn get_cargo_metadata(manifest_path: &ManifestPath) -> Result<(CargoMetadata, Package)> { let mut cmd = MetadataCommand::new(); let metadata = cmd - .manifest_path(manifest_path) + .manifest_path(manifest_path.as_ref()) .exec() .context("Error invoking `cargo metadata`")?; let root_package_id = metadata diff --git a/src/workspace/manifest.rs b/src/workspace/manifest.rs index b96a8b67..bf41a8e9 100644 --- a/src/workspace/manifest.rs +++ b/src/workspace/manifest.rs @@ -88,6 +88,12 @@ impl AsRef for ManifestPath { } } +impl From for PathBuf { + fn from(path: ManifestPath) -> Self { + path.path + } +} + /// Create, amend and save a copy of the specified `Cargo.toml`. pub struct Manifest { path: ManifestPath, -- GitLab