diff options
Diffstat (limited to 'crates/ra_project_model/src/cargo_workspace.rs')
-rw-r--r-- | crates/ra_project_model/src/cargo_workspace.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/crates/ra_project_model/src/cargo_workspace.rs b/crates/ra_project_model/src/cargo_workspace.rs index e28aca259..81cb506b7 100644 --- a/crates/ra_project_model/src/cargo_workspace.rs +++ b/crates/ra_project_model/src/cargo_workspace.rs | |||
@@ -4,6 +4,7 @@ use cargo_metadata::{MetadataCommand, CargoOpt}; | |||
4 | use ra_arena::{Arena, RawId, impl_arena_id}; | 4 | use ra_arena::{Arena, RawId, impl_arena_id}; |
5 | use rustc_hash::FxHashMap; | 5 | use rustc_hash::FxHashMap; |
6 | use failure::format_err; | 6 | use failure::format_err; |
7 | use ra_db::Edition; | ||
7 | 8 | ||
8 | use crate::Result; | 9 | use crate::Result; |
9 | 10 | ||
@@ -35,7 +36,7 @@ struct PackageData { | |||
35 | targets: Vec<Target>, | 36 | targets: Vec<Target>, |
36 | is_member: bool, | 37 | is_member: bool, |
37 | dependencies: Vec<PackageDependency>, | 38 | dependencies: Vec<PackageDependency>, |
38 | edition: String, | 39 | edition: Edition, |
39 | } | 40 | } |
40 | 41 | ||
41 | #[derive(Debug, Clone)] | 42 | #[derive(Debug, Clone)] |
@@ -85,8 +86,8 @@ impl Package { | |||
85 | pub fn root(self, ws: &CargoWorkspace) -> &Path { | 86 | pub fn root(self, ws: &CargoWorkspace) -> &Path { |
86 | ws.packages[self].manifest.parent().unwrap() | 87 | ws.packages[self].manifest.parent().unwrap() |
87 | } | 88 | } |
88 | pub fn edition(self, ws: &CargoWorkspace) -> &str { | 89 | pub fn edition(self, ws: &CargoWorkspace) -> Edition { |
89 | &ws.packages[self].edition | 90 | ws.packages[self].edition |
90 | } | 91 | } |
91 | pub fn targets<'a>(self, ws: &'a CargoWorkspace) -> impl Iterator<Item = Target> + 'a { | 92 | pub fn targets<'a>(self, ws: &'a CargoWorkspace) -> impl Iterator<Item = Target> + 'a { |
92 | ws.packages[self].targets.iter().cloned() | 93 | ws.packages[self].targets.iter().cloned() |
@@ -139,7 +140,7 @@ impl CargoWorkspace { | |||
139 | manifest: meta_pkg.manifest_path.clone(), | 140 | manifest: meta_pkg.manifest_path.clone(), |
140 | targets: Vec::new(), | 141 | targets: Vec::new(), |
141 | is_member, | 142 | is_member, |
142 | edition: meta_pkg.edition, | 143 | edition: Edition::from_string(&meta_pkg.edition), |
143 | dependencies: Vec::new(), | 144 | dependencies: Vec::new(), |
144 | }); | 145 | }); |
145 | let pkg_data = &mut packages[pkg]; | 146 | let pkg_data = &mut packages[pkg]; |