File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ fn preprocess_single_lines(comment: &str, indent: usize) -> String {
4848 let mut is_first = true ;
4949 let lines: Vec < _ > = comment
5050 . lines ( )
51- . map ( |l| l. trim ( ) . trim_left_matches ( '/' ) )
51+ . map ( |l| l. trim ( ) . trim_start_matches ( '/' ) )
5252 . map ( |l| {
5353 let indent = if is_first { "" } else { & * indent } ;
5454 is_first = false ;
@@ -60,15 +60,15 @@ fn preprocess_single_lines(comment: &str, indent: usize) -> String {
6060
6161fn preprocess_multi_line ( comment : & str , indent : usize ) -> String {
6262 let comment = comment
63- . trim_left_matches ( '/' )
64- . trim_right_matches ( '/' )
65- . trim_right_matches ( '*' ) ;
63+ . trim_start_matches ( '/' )
64+ . trim_end_matches ( '/' )
65+ . trim_end_matches ( '*' ) ;
6666
6767 let indent = make_indent ( indent) ;
6868 // Strip any potential `*` characters preceding each line.
6969 let mut is_first = true ;
7070 let mut lines: Vec < _ > = comment. lines ( )
71- . map ( |line| line. trim ( ) . trim_left_matches ( '*' ) . trim_left_matches ( '!' ) )
71+ . map ( |line| line. trim ( ) . trim_start_matches ( '*' ) . trim_start_matches ( '!' ) )
7272 . skip_while ( |line| line. trim ( ) . is_empty ( ) ) // Skip the first empty lines.
7373 . map ( |line| {
7474 let indent = if is_first { "" } else { & * indent } ;
You can’t perform that action at this time.
0 commit comments