Support rust edition in playground. (#946)
The endpoint was recently updated to support the edition param.
This commit is contained in:
parent
f4017376a9
commit
1d3ec7e0c7
|
@ -101,11 +101,15 @@ function playpen_text(playpen) {
|
||||||
}
|
}
|
||||||
|
|
||||||
let text = playpen_text(code_block);
|
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 = {
|
var params = {
|
||||||
version: "stable",
|
version: "stable",
|
||||||
optimize: "0",
|
optimize: "0",
|
||||||
code: text
|
code: text,
|
||||||
|
edition: edition
|
||||||
};
|
};
|
||||||
|
|
||||||
if (text.indexOf("#![feature") !== -1) {
|
if (text.indexOf("#![feature") !== -1) {
|
||||||
|
|
Loading…
Reference in New Issue