Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use PathBuf in cargo metadata #6511

Merged
merged 2 commits into from
Jan 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/cargo/core/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ struct SerializedPackage<'a> {
dependencies: &'a [Dependency],
targets: Vec<&'a Target>,
features: &'a FeatureMap,
manifest_path: &'a str,
manifest_path: &'a Path,
metadata: Option<&'a toml::Value>,
authors: &'a [String],
categories: &'a [String],
Expand Down Expand Up @@ -113,7 +113,7 @@ impl ser::Serialize for Package {
dependencies: summary.dependencies(),
targets,
features: summary.features(),
manifest_path: &self.manifest_path.display().to_string(),
manifest_path: &self.manifest_path,
metadata: self.manifest.custom_metadata(),
authors,
categories,
Expand Down
13 changes: 7 additions & 6 deletions src/cargo/ops/cargo_output_metadata.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use std::collections::HashMap;
use std::path::PathBuf;

use serde::ser;
use serde::Serialize;
Expand Down Expand Up @@ -41,9 +42,9 @@ fn metadata_no_deps(ws: &Workspace<'_>, _opt: &OutputMetadataOptions) -> CargoRe
packages: ws.members().cloned().collect(),
workspace_members: ws.members().map(|pkg| pkg.package_id()).collect(),
resolve: None,
target_directory: ws.target_dir().display().to_string(),
target_directory: ws.target_dir().clone().into_path_unlocked(),
version: VERSION,
workspace_root: ws.root().display().to_string(),
workspace_root: ws.root().to_path_buf(),
})
}

Expand All @@ -69,9 +70,9 @@ fn metadata_full(ws: &Workspace<'_>, opt: &OutputMetadataOptions) -> CargoResult
resolve: (packages, resolve),
root: ws.current_opt().map(|pkg| pkg.package_id()),
}),
target_directory: ws.target_dir().display().to_string(),
target_directory: ws.target_dir().clone().into_path_unlocked(),
version: VERSION,
workspace_root: ws.root().display().to_string(),
workspace_root: ws.root().to_path_buf(),
})
}

Expand All @@ -80,9 +81,9 @@ pub struct ExportInfo {
packages: Vec<Package>,
workspace_members: Vec<PackageId>,
resolve: Option<MetadataResolve>,
target_directory: String,
target_directory: PathBuf,
version: u32,
workspace_root: String,
workspace_root: PathBuf,
}

/// Newtype wrapper to provide a custom `Serialize` implementation.
Expand Down