Merge pull request #717 from Eijebong/metadata

Update cargo_metadata to 0.7
This commit is contained in:
Ralf Jung 2019-04-27 23:59:44 +02:00 committed by GitHub
commit 048ce3cb1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View File

@ -34,7 +34,7 @@ required-features = ["rustc_tests"]
[dependencies]
byteorder = { version = "1.1", features = ["i128"]}
cargo_metadata = { version = "0.6", optional = true }
cargo_metadata = { version = "0.7", optional = true }
directories = { version = "1.0", optional = true }
rustc_version = { version = "0.2.3", optional = true }
env_logger = "0.6"

View File

@ -83,10 +83,11 @@ fn list_targets() -> impl Iterator<Item=cargo_metadata::Target> {
Path::new(&m).canonicalize().unwrap()
);
let mut metadata = if let Ok(metadata) = cargo_metadata::metadata(
manifest_path.as_ref().map(AsRef::as_ref),
)
{
let mut cmd = cargo_metadata::MetadataCommand::new();
if let Some(ref manifest_path) = manifest_path {
cmd.manifest_path(manifest_path);
}
let mut metadata = if let Ok(metadata) = cmd.exec() {
metadata
} else {
show_error(format!("Could not obtain Cargo metadata"));