File tree 1 file changed +8
-4
lines changed 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,10 @@ impl Serializer {
52
52
match entry {
53
53
Entry :: Message ( msg) => self . serialize_message ( msg) ,
54
54
Entry :: Comment ( comment) => {
55
+ if self . state . has_entries {
56
+ self . writer . newline ( ) ;
57
+ }
58
+
55
59
self . serialize_comment ( comment) ?;
56
60
self . writer . newline ( ) ;
57
61
Ok ( ( ) )
@@ -71,10 +75,6 @@ impl Serializer {
71
75
Comment :: ResourceComment { content } => ( "###" , content) ,
72
76
} ;
73
77
74
- if self . state . has_entries {
75
- self . writer . newline ( ) ;
76
- }
77
-
78
78
for line in lines {
79
79
self . writer . write_literal ( prefix) ?;
80
80
@@ -480,6 +480,10 @@ mod serialize_resource_tests {
480
480
message_comment,
481
481
"# A multiline\n # message comment.\n foo = Foo\n " ,
482
482
) ;
483
+ round_trip_test ! (
484
+ dont_prefix_a_subsequent_entry_comment_with_a_newline,
485
+ "first = Firstsubsequent_ Comment\n foo = Foo\n " ,
486
+ ) ;
483
487
round_trip_test ! (
484
488
group_comment,
485
489
"## Comment Header\n ##\n ## A multiline\n ## group comment.\n \n foo = Foo\n " ,
You can’t perform that action at this time.
0 commit comments