From db43b44f71818df4d6cc100969d21a65d3ce2645 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 14 Jan 2019 16:15:25 +0300 Subject: update cargo_metadata --- crates/ra_lsp_server/src/project_model/cargo_workspace.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'crates/ra_lsp_server/src/project_model') diff --git a/crates/ra_lsp_server/src/project_model/cargo_workspace.rs b/crates/ra_lsp_server/src/project_model/cargo_workspace.rs index 8f7518860..75ae78bca 100644 --- a/crates/ra_lsp_server/src/project_model/cargo_workspace.rs +++ b/crates/ra_lsp_server/src/project_model/cargo_workspace.rs @@ -1,6 +1,6 @@ use std::path::{Path, PathBuf}; -use cargo_metadata::{metadata_run, CargoOpt}; +use cargo_metadata::{MetadataCommand, CargoOpt}; use ra_syntax::SmolStr; use ra_arena::{Arena, RawId, impl_arena_id}; use rustc_hash::FxHashMap; @@ -117,7 +117,10 @@ impl Target { impl CargoWorkspace { pub fn from_cargo_metadata(cargo_toml: &Path) -> Result { - let meta = metadata_run(Some(cargo_toml), true, Some(CargoOpt::AllFeatures)) + let meta = MetadataCommand::new() + .manifest_path(cargo_toml) + .features(CargoOpt::AllFeatures) + .exec() .map_err(|e| format_err!("cargo metadata failed: {}", e))?; let mut pkg_by_id = FxHashMap::default(); let mut packages = Arena::default(); -- cgit v1.2.3