Skip to content

Commit 8e949e6

Browse files
authored
Merge pull request #87 from tinaun/patch-1
add edition 2021 support
2 parents 6364809 + c59a19b commit 8e949e6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/playground.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ impl<'a> PlaygroundCode<'a> {
4242
let edition = match self.edition {
4343
Edition::E2015 => "2015",
4444
Edition::E2018 => "2018",
45+
Edition::E2021 => "2021",
4546
};
4647

4748
let mode = match self.mode {
@@ -83,6 +84,8 @@ enum Edition {
8384
E2015,
8485
#[serde(rename = "2018")]
8586
E2018,
87+
#[serde(rename = "2021")]
88+
E2021,
8689
}
8790

8891
impl FromStr for Edition {
@@ -92,6 +95,7 @@ impl FromStr for Edition {
9295
match s {
9396
"2015" => Ok(Edition::E2015),
9497
"2018" => Ok(Edition::E2018),
98+
"2021" => Ok(Edition::E2021),
9599
_ => Err(format!("invalid edition `{}`", s).into()),
96100
}
97101
}
@@ -230,7 +234,7 @@ pub fn help(args: Args, name: &str) -> Result<(), Error> {
230234
Optional arguments:
231235
\tmode: debug, release (default: debug)
232236
\tchannel: stable, beta, nightly (default: nightly)
233-
\tedition: 2015, 2018 (default: 2018)
237+
\tedition: 2015, 2018, 2021 (default: 2018)
234238
\twarn: boolean flag to enable compilation warnings
235239
",
236240
name

0 commit comments

Comments
 (0)