aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_project_model/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_project_model/src')
-rw-r--r--crates/ra_project_model/src/lib.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/crates/ra_project_model/src/lib.rs b/crates/ra_project_model/src/lib.rs
index a99612690..7ad941279 100644
--- a/crates/ra_project_model/src/lib.rs
+++ b/crates/ra_project_model/src/lib.rs
@@ -32,6 +32,12 @@ pub enum ProjectWorkspace {
32 Json { project: JsonProject }, 32 Json { project: JsonProject },
33} 33}
34 34
35impl From<JsonProject> for ProjectWorkspace {
36 fn from(project: JsonProject) -> ProjectWorkspace {
37 ProjectWorkspace::Json { project }
38 }
39}
40
35/// `PackageRoot` describes a package root folder. 41/// `PackageRoot` describes a package root folder.
36/// Which may be an external dependency, or a member of 42/// Which may be an external dependency, or a member of
37/// the current workspace. 43/// the current workspace.
@@ -144,11 +150,11 @@ impl ProjectManifest {
144 150
145impl ProjectWorkspace { 151impl ProjectWorkspace {
146 pub fn load( 152 pub fn load(
147 root: ProjectManifest, 153 manifest: ProjectManifest,
148 cargo_features: &CargoConfig, 154 cargo_features: &CargoConfig,
149 with_sysroot: bool, 155 with_sysroot: bool,
150 ) -> Result<ProjectWorkspace> { 156 ) -> Result<ProjectWorkspace> {
151 let res = match root { 157 let res = match manifest {
152 ProjectManifest::ProjectJson(project_json) => { 158 ProjectManifest::ProjectJson(project_json) => {
153 let file = File::open(&project_json).with_context(|| { 159 let file = File::open(&project_json).with_context(|| {
154 format!("Failed to open json file {}", project_json.display()) 160 format!("Failed to open json file {}", project_json.display())