Support rust edition in playground. (#946)

The endpoint was recently updated to support the edition param.
This commit is contained in:
Eric Huss 2019-05-31 08:59:44 -07:00 committed by Dylan DPC
parent f4017376a9
commit 1d3ec7e0c7
1 changed files with 5 additions and 1 deletions

View File

@ -101,11 +101,15 @@ function playpen_text(playpen) {
}
let text = playpen_text(code_block);
let classes = code_block.querySelector('code').classList;
let has_2018 = classes.contains("edition2018");
let edition = has_2018 ? "2018" : "2015";
var params = {
version: "stable",
optimize: "0",
code: text
code: text,
edition: edition
};
if (text.indexOf("#![feature") !== -1) {