File tree 3 files changed +3
-23
lines changed 3 files changed +3
-23
lines changed Original file line number Diff line number Diff line change @@ -626,7 +626,7 @@ impl<'a> CommentRewrite<'a> {
626
626
_ if self . code_block_buffer . is_empty ( ) => String :: new ( ) ,
627
627
_ => {
628
628
let mut config = self . fmt . config . clone ( ) ;
629
- config. set ( ) . format_doc_comments ( false ) ;
629
+ config. set ( ) . wrap_comments ( false ) ;
630
630
match :: format_code_block ( & self . code_block_buffer , & config) {
631
631
Some ( ref s) => trim_custom_comment_prefix ( & s. snippet ) ,
632
632
None => trim_custom_comment_prefix ( & self . code_block_buffer ) ,
@@ -798,16 +798,9 @@ fn trim_custom_comment_prefix(s: &str) -> String {
798
798
. map ( |line| {
799
799
let left_trimmed = line. trim_left ( ) ;
800
800
if left_trimmed. starts_with ( RUSTFMT_CUSTOM_COMMENT_PREFIX ) {
801
- let orig = left_trimmed. trim_left_matches ( RUSTFMT_CUSTOM_COMMENT_PREFIX ) ;
802
- // due to comment wrapping, a line that was originally behind `#` is split over
803
- // multiple lines, which needs then to be prefixed with a `#`
804
- if !orig. trim_left ( ) . starts_with ( "# " ) {
805
- Cow :: from ( format ! ( "# {}" , orig) )
806
- } else {
807
- Cow :: from ( orig)
808
- }
801
+ left_trimmed. trim_left_matches ( RUSTFMT_CUSTOM_COMMENT_PREFIX )
809
802
} else {
810
- Cow :: from ( line)
803
+ line
811
804
}
812
805
} )
813
806
. collect :: < Vec < _ > > ( )
File renamed without changes.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments