@@ -513,8 +513,6 @@ pub struct Playpen {
513513 pub copy_js : bool ,
514514 /// Display line numbers on playpen snippets. Default: `false`.
515515 pub line_numbers : bool ,
516- /// Rust edition to use for the code. Default: `2015`.
517- pub edition : RustEdition ,
518516}
519517
520518impl Default for Playpen {
@@ -524,66 +522,10 @@ impl Default for Playpen {
524522 copyable : true ,
525523 copy_js : true ,
526524 line_numbers : false ,
527- edition : RustEdition :: E2015 ,
528525 }
529526 }
530527}
531528
532- #[ derive( Debug , Clone , PartialEq ) ]
533- /// The edition of Rust used in a playpen code snippet
534- pub enum RustEdition {
535- /// The 2018 edition of Rust
536- E2018 ,
537- /// The 2015 edition of Rust
538- E2015 ,
539- }
540-
541- impl Default for RustEdition {
542- fn default ( ) -> Self {
543- RustEdition :: E2015
544- }
545- }
546-
547- impl Serialize for RustEdition {
548- fn serialize < S > ( & self , serializer : S ) -> std:: result:: Result < S :: Ok , S :: Error >
549- where
550- S : Serializer ,
551- {
552- match self {
553- RustEdition :: E2015 => serializer. serialize_str ( "2015" ) ,
554- RustEdition :: E2018 => serializer. serialize_str ( "2018" ) ,
555- }
556- }
557- }
558-
559- impl < ' de > Deserialize < ' de > for RustEdition {
560- fn deserialize < D > ( de : D ) -> std:: result:: Result < Self , D :: Error >
561- where
562- D : Deserializer < ' de > ,
563- {
564- use serde:: de:: Error ;
565-
566- let raw = Value :: deserialize ( de) ?;
567-
568- let edition = match raw {
569- Value :: String ( s) => s,
570- _ => {
571- return Err ( D :: Error :: custom ( "Rust edition should be a string" ) ) ;
572- }
573- } ;
574-
575- let edition = match edition. as_str ( ) {
576- "2018" => RustEdition :: E2018 ,
577- "2015" => RustEdition :: E2015 ,
578- _ => {
579- return Err ( D :: Error :: custom ( "Unknown Rust edition" ) ) ;
580- }
581- } ;
582-
583- Ok ( edition)
584- }
585- }
586-
587529/// Configuration of the search functionality of the HTML renderer.
588530#[ derive( Debug , Clone , PartialEq , Serialize , Deserialize ) ]
589531#[ serde( default , rename_all = "kebab-case" ) ]
@@ -688,7 +630,6 @@ mod tests {
688630 [output.html.playpen]
689631 editable = true
690632 editor = "ace"
691- edition = "2018"
692633
693634 [preprocessor.first]
694635
@@ -717,7 +658,6 @@ mod tests {
717658 copyable : true ,
718659 copy_js : true ,
719660 line_numbers : false ,
720- edition : RustEdition :: E2018 ,
721661 } ;
722662 let html_should_be = HtmlConfig {
723663 curly_quotes : true ,
0 commit comments