diff options
author | Wilco Kusee <[email protected]> | 2020-01-08 13:04:47 +0000 |
---|---|---|
committer | Wilco Kusee <[email protected]> | 2020-01-08 13:06:08 +0000 |
commit | 003620f0d61c1c8792453294d9b2ef535afc2831 (patch) | |
tree | 37f5d4ab7f215e2ff775ac632a8f6d4be89f994e /crates/ra_project_model/src/cargo_workspace.rs | |
parent | e7bb82c3a494e08cbcd283b8292579a9cf0bb1a3 (diff) |
Use downcasting for CargoTomlNotFoundError
Diffstat (limited to 'crates/ra_project_model/src/cargo_workspace.rs')
-rw-r--r-- | crates/ra_project_model/src/cargo_workspace.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_project_model/src/cargo_workspace.rs b/crates/ra_project_model/src/cargo_workspace.rs index 446ccfda0..1b3c246c7 100644 --- a/crates/ra_project_model/src/cargo_workspace.rs +++ b/crates/ra_project_model/src/cargo_workspace.rs | |||
@@ -8,7 +8,7 @@ use ra_db::Edition; | |||
8 | use rustc_hash::FxHashMap; | 8 | use rustc_hash::FxHashMap; |
9 | use serde::Deserialize; | 9 | use serde::Deserialize; |
10 | 10 | ||
11 | use crate::WorkspaceError; | 11 | use crate::Result; |
12 | 12 | ||
13 | /// `CargoWorkspace` represents the logical structure of, well, a Cargo | 13 | /// `CargoWorkspace` represents the logical structure of, well, a Cargo |
14 | /// workspace. It pretty closely mirrors `cargo metadata` output. | 14 | /// workspace. It pretty closely mirrors `cargo metadata` output. |
@@ -156,7 +156,7 @@ impl CargoWorkspace { | |||
156 | pub fn from_cargo_metadata( | 156 | pub fn from_cargo_metadata( |
157 | cargo_toml: &Path, | 157 | cargo_toml: &Path, |
158 | cargo_features: &CargoFeatures, | 158 | cargo_features: &CargoFeatures, |
159 | ) -> Result<CargoWorkspace, WorkspaceError> { | 159 | ) -> Result<CargoWorkspace> { |
160 | let mut meta = MetadataCommand::new(); | 160 | let mut meta = MetadataCommand::new(); |
161 | meta.manifest_path(cargo_toml); | 161 | meta.manifest_path(cargo_toml); |
162 | if cargo_features.all_features { | 162 | if cargo_features.all_features { |
@@ -171,7 +171,7 @@ impl CargoWorkspace { | |||
171 | if let Some(parent) = cargo_toml.parent() { | 171 | if let Some(parent) = cargo_toml.parent() { |
172 | meta.current_dir(parent); | 172 | meta.current_dir(parent); |
173 | } | 173 | } |
174 | let meta = meta.exec().map_err(|e| WorkspaceError::CargoMetadataFailed(e))?; | 174 | let meta = meta.exec().map_err(|e| format!("cargo metadata failed: {}", e))?; |
175 | let mut pkg_by_id = FxHashMap::default(); | 175 | let mut pkg_by_id = FxHashMap::default(); |
176 | let mut packages = Arena::default(); | 176 | let mut packages = Arena::default(); |
177 | let mut targets = Arena::default(); | 177 | let mut targets = Arena::default(); |