Skip to content

Commit 56d65ec

Browse files
committed
add 2024 edition
1 parent eb338ec commit 56d65ec

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/playground.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ impl PlaygroundCode {
4444
Edition::E2015 => "2015",
4545
Edition::E2018 => "2018",
4646
Edition::E2021 => "2021",
47+
Edition::E2024 => "2024",
4748
};
4849

4950
let mode = match self.mode {
@@ -87,6 +88,8 @@ enum Edition {
8788
E2018,
8889
#[serde(rename = "2021")]
8990
E2021,
91+
#[serde(rename = "2024")]
92+
E2024,
9093
}
9194

9295
impl FromStr for Edition {
@@ -97,6 +100,7 @@ impl FromStr for Edition {
97100
"2015" => Ok(Edition::E2015),
98101
"2018" => Ok(Edition::E2018),
99102
"2021" => Ok(Edition::E2021),
103+
"2024" => Ok(Edition::E2024),
100104
_ => Err(format!("invalid edition `{}`", s).into()),
101105
}
102106
}
@@ -146,7 +150,7 @@ async fn run_code(args: Arc<Args>, code: String) -> Result<String, Error> {
146150
.map(|s| &s[..])
147151
.unwrap_or("nightly");
148152
let mode = args.params.get("mode").map(|s| &s[..]).unwrap_or("debug");
149-
let edition = args.params.get("edition").map(|s| &s[..]).unwrap_or("2021");
153+
let edition = args.params.get("edition").map(|s| &s[..]).unwrap_or("2024");
150154

151155
let mut request = PlaygroundCode::new(code.clone());
152156

@@ -249,7 +253,7 @@ pub async fn help(args: Arc<Args>, name: &str) -> Result<(), Error> {
249253
Optional arguments:
250254
\tmode: debug, release (default: debug)
251255
\tchannel: stable, beta, nightly (default: nightly)
252-
\tedition: 2015, 2018, 2021 (default: 2021)
256+
\tedition: 2015, 2018, 2021, 2024 (default: 2024)
253257
\twarn: boolean flag to enable compilation warnings
254258
",
255259
name

0 commit comments

Comments
 (0)