Skip to content

Commit

Permalink
Support rust edition in playground. (rust-lang#946)
Browse files Browse the repository at this point in the history
The endpoint was recently updated to support the edition param.
  • Loading branch information
ehuss authored and Dylan-DPC committed May 31, 2019
1 parent 93ad20a commit dd729ee
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/theme/book.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit dd729ee

Please sign in to comment.