File tree 1 file changed +11
-9
lines changed
1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -358,30 +358,32 @@ function run_rust_code(code_block) {
358
358
result_block = code_block . find ( ".result" ) ;
359
359
}
360
360
361
- let text = playpen_text ( code_block ) ; ;
362
-
361
+ let text = playpen_text ( code_block ) ;
362
+
363
363
var params = {
364
- version : "stable" ,
365
- optimize : "0" ,
366
- code : text ,
367
- } ;
364
+ channel : "stable" ,
365
+ mode : "debug" ,
366
+ crateType : "bin" ,
367
+ tests : false ,
368
+ code : text ,
369
+ }
368
370
369
371
if ( text . indexOf ( "#![feature" ) !== - 1 ) {
370
- params . version = "nightly" ;
372
+ params . channel = "nightly" ;
371
373
}
372
374
373
375
result_block . text ( "Running..." ) ;
374
376
375
377
$ . ajax ( {
376
- url : "https://play.rust-lang.org/evaluate.json " ,
378
+ url : "https://play.rust-lang.org/execute " ,
377
379
method : "POST" ,
378
380
crossDomain : true ,
379
381
dataType : "json" ,
380
382
contentType : "application/json" ,
381
383
data : JSON . stringify ( params ) ,
382
384
timeout : 15000 ,
383
385
success : function ( response ) {
384
- result_block . text ( response . result ) ;
386
+ result_block . text ( response . success ? response . stdout : response . stderr ) ;
385
387
} ,
386
388
error : function ( qXHR , textStatus , errorThrown ) {
387
389
result_block . text ( "Playground communication " + textStatus ) ;
You can’t perform that action at this time.
0 commit comments