@@ -10,7 +10,7 @@ use std::io::{BufRead, BufReader, Read};
1010lazy_static ! {
1111 static ref META_SYNTAXES_C : [ MetaSyntax ; 2 ] = [
1212 MetaSyntax :: new( "//" , None ) ,
13- MetaSyntax :: new( "/\\ *" , Some ( " \ \ */") )
13+ MetaSyntax :: new( r "/\*", Some ( r" \*/") )
1414 ] ;
1515 static ref META_SYNTAXES_HTML : [ MetaSyntax ; 1 ] = [ MetaSyntax :: new( "<!--" , Some ( "-->" ) ) ] ;
1616 static ref META_SYNTAXES_PY : [ MetaSyntax ; 1 ] = [ MetaSyntax :: new( "#" , None ) ] ;
@@ -47,29 +47,29 @@ struct MetaSyntax {
4747impl MetaSyntax {
4848 fn new ( comment_start : & ' static str , comment_end : Option < & ' static str > ) -> Self {
4949 // comment patterns
50- let comment_start_pattern = format ! ( "^(\\ s*){}\ \ s*" , comment_start) ;
50+ let comment_start_pattern = format ! ( r "^(\s*){}\s*", comment_start) ;
5151 let comment_end_pattern = match comment_end {
52- Some ( s) => format ! ( "(.*){}\ \ s*" , s) ,
52+ Some ( s) => format ! ( r "(.*){}\s*", s) ,
5353 None => "(.*)" . to_string ( ) ,
5454 } ;
5555
5656 // annotation patterns
5757 let solution_file = Regex :: new ( & format ! (
58- "{}SOLUTION\ \ s+FILE{}" ,
58+ r "{}SOLUTION\s+FILE{}",
5959 comment_start_pattern, comment_end_pattern
6060 ) )
6161 . unwrap ( ) ;
6262 let solution_begin = Regex :: new ( & format ! (
63- "{}BEGIN\ \ s+SOLUTION{}" ,
63+ r "{}BEGIN\s+SOLUTION{}",
6464 comment_start_pattern, comment_end_pattern
6565 ) )
6666 . unwrap ( ) ;
6767 let solution_end = Regex :: new ( & format ! (
68- "{}END\ \ s+SOLUTION{}" ,
68+ r "{}END\s+SOLUTION{}",
6969 comment_start_pattern, comment_end_pattern
7070 ) )
7171 . unwrap ( ) ;
72- let stub_begin = Regex :: new ( & format ! ( "{}STUB:\ \ s*" , comment_start_pattern) ) . unwrap ( ) ;
72+ let stub_begin = Regex :: new ( & format ! ( r "{}STUB:\s*", comment_start_pattern) ) . unwrap ( ) ;
7373 let stub_end = Regex :: new ( & comment_end_pattern) . unwrap ( ) ;
7474
7575 Self {
0 commit comments