Skip to content

Commit 37da8da

Browse files
authored
Improve edition parsing (eupn#92)
Do not use enum for edition for future-compatibility.
1 parent 95de86e commit 37da8da

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/manifest.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,9 @@ pub struct Package {
2828
pub publish: bool,
2929
}
3030

31+
// Do not use enum for edition for future-compatibility.
3132
#[derive(Serialize, Deserialize, Debug)]
32-
pub enum Edition {
33-
#[serde(rename = "2015")]
34-
E2015,
35-
#[serde(rename = "2018")]
36-
E2018,
37-
}
33+
pub struct Edition(pub String);
3834

3935
#[derive(Serialize, Debug)]
4036
pub struct Bin {
@@ -60,7 +56,7 @@ pub struct Workspace {}
6056

6157
impl Default for Edition {
6258
fn default() -> Self {
63-
Edition::E2018
59+
Self("2021".into())
6460
}
6561
}
6662

0 commit comments

Comments
 (0)