File tree Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -612,7 +612,11 @@ pub(crate) fn extract_post_comment(
612
612
post_snippet[ 1 ..] . trim_matches ( white_space)
613
613
} else if post_snippet. starts_with ( separator) {
614
614
post_snippet[ separator. len ( ) ..] . trim_matches ( white_space)
615
- } else if post_snippet. ends_with ( ',' ) && !post_snippet. trim ( ) . starts_with ( "//" ) {
615
+ }
616
+ // not comment or over two lines
617
+ else if post_snippet. ends_with ( ',' )
618
+ && ( !post_snippet. trim ( ) . starts_with ( "//" ) || post_snippet. trim ( ) . contains ( '\n' ) )
619
+ {
616
620
post_snippet[ ..( post_snippet. len ( ) - 1 ) ] . trim_matches ( white_space)
617
621
} else {
618
622
post_snippet
Original file line number Diff line number Diff line change
1
+ fn main ( ) {
2
+ println ! ( "{}"
3
+ // comment
4
+ , 111 ) ;
5
+ }
Original file line number Diff line number Diff line change
1
+ fn main ( ) {
2
+ println ! (
3
+ "{}" , // comment
4
+ 111
5
+ ) ;
6
+ }
You can’t perform that action at this time.
0 commit comments