File tree 1 file changed +3
-5
lines changed
1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change 2
2
3
3
use std:: { borrow:: Cow , iter} ;
4
4
5
- use itertools:: { MultiPeek , multipeek} ;
5
+ use itertools:: { Itertools as _ , MultiPeek , multipeek} ;
6
6
use rustc_span:: Span ;
7
7
use tracing:: { debug, trace} ;
8
8
@@ -1056,8 +1056,7 @@ fn light_rewrite_comment(
1056
1056
config : & Config ,
1057
1057
is_doc_comment : bool ,
1058
1058
) -> String {
1059
- let lines: Vec < & str > = orig
1060
- . lines ( )
1059
+ orig. lines ( )
1061
1060
. map ( |l| {
1062
1061
// This is basically just l.trim(), but in the case that a line starts
1063
1062
// with `*` we want to leave one space before it, so it aligns with the
@@ -1075,8 +1074,7 @@ fn light_rewrite_comment(
1075
1074
// Preserve markdown's double-space line break syntax in doc comment.
1076
1075
trim_end_unless_two_whitespaces ( left_trimmed, is_doc_comment)
1077
1076
} )
1078
- . collect ( ) ;
1079
- lines. join ( & format ! ( "\n {}" , offset. to_string( config) ) )
1077
+ . join ( & format ! ( "\n {}" , offset. to_string( config) ) )
1080
1078
}
1081
1079
1082
1080
/// Trims comment characters and possibly a single space from the left of a string.
You can’t perform that action at this time.
0 commit comments