File tree 1 file changed +5
-5
lines changed
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 {
48
48
let mut is_first = true ;
49
49
let lines: Vec < _ > = comment
50
50
. lines ( )
51
- . map ( |l| l. trim ( ) . trim_left_matches ( '/' ) )
51
+ . map ( |l| l. trim ( ) . trim_start_matches ( '/' ) )
52
52
. map ( |l| {
53
53
let indent = if is_first { "" } else { & * indent } ;
54
54
is_first = false ;
@@ -60,15 +60,15 @@ fn preprocess_single_lines(comment: &str, indent: usize) -> String {
60
60
61
61
fn preprocess_multi_line ( comment : & str , indent : usize ) -> String {
62
62
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 ( '*' ) ;
66
66
67
67
let indent = make_indent ( indent) ;
68
68
// Strip any potential `*` characters preceding each line.
69
69
let mut is_first = true ;
70
70
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 ( '!' ) )
72
72
. skip_while ( |line| line. trim ( ) . is_empty ( ) ) // Skip the first empty lines.
73
73
. map ( |line| {
74
74
let indent = if is_first { "" } else { & * indent } ;
You can’t perform that action at this time.
0 commit comments