diff options
author | Florian Diebold <[email protected]> | 2019-02-10 21:34:29 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2019-02-13 19:10:46 +0000 |
commit | 3a9934e2c3280864877a90c5ced777bad898d73a (patch) | |
tree | b37994dc169b216a2d11a11bbe91503526d9b2dd /crates/ra_project_model/src/cargo_workspace.rs | |
parent | 1526eb25c98fd16a9c0d114d0ed44e8fec1cc19c (diff) |
Keep track of crate edition
Diffstat (limited to 'crates/ra_project_model/src/cargo_workspace.rs')
-rw-r--r-- | crates/ra_project_model/src/cargo_workspace.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/crates/ra_project_model/src/cargo_workspace.rs b/crates/ra_project_model/src/cargo_workspace.rs index 5866be519..e28aca259 100644 --- a/crates/ra_project_model/src/cargo_workspace.rs +++ b/crates/ra_project_model/src/cargo_workspace.rs | |||
@@ -35,6 +35,7 @@ struct PackageData { | |||
35 | targets: Vec<Target>, | 35 | targets: Vec<Target>, |
36 | is_member: bool, | 36 | is_member: bool, |
37 | dependencies: Vec<PackageDependency>, | 37 | dependencies: Vec<PackageDependency>, |
38 | edition: String, | ||
38 | } | 39 | } |
39 | 40 | ||
40 | #[derive(Debug, Clone)] | 41 | #[derive(Debug, Clone)] |
@@ -84,6 +85,9 @@ impl Package { | |||
84 | pub fn root(self, ws: &CargoWorkspace) -> &Path { | 85 | pub fn root(self, ws: &CargoWorkspace) -> &Path { |
85 | ws.packages[self].manifest.parent().unwrap() | 86 | ws.packages[self].manifest.parent().unwrap() |
86 | } | 87 | } |
88 | pub fn edition(self, ws: &CargoWorkspace) -> &str { | ||
89 | &ws.packages[self].edition | ||
90 | } | ||
87 | pub fn targets<'a>(self, ws: &'a CargoWorkspace) -> impl Iterator<Item = Target> + 'a { | 91 | pub fn targets<'a>(self, ws: &'a CargoWorkspace) -> impl Iterator<Item = Target> + 'a { |
88 | ws.packages[self].targets.iter().cloned() | 92 | ws.packages[self].targets.iter().cloned() |
89 | } | 93 | } |
@@ -135,6 +139,7 @@ impl CargoWorkspace { | |||
135 | manifest: meta_pkg.manifest_path.clone(), | 139 | manifest: meta_pkg.manifest_path.clone(), |
136 | targets: Vec::new(), | 140 | targets: Vec::new(), |
137 | is_member, | 141 | is_member, |
142 | edition: meta_pkg.edition, | ||
138 | dependencies: Vec::new(), | 143 | dependencies: Vec::new(), |
139 | }); | 144 | }); |
140 | let pkg_data = &mut packages[pkg]; | 145 | let pkg_data = &mut packages[pkg]; |