We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 480374a commit 791f545Copy full SHA for 791f545
src/libsyntax/print/pprust.rs
@@ -1537,6 +1537,9 @@ impl<'a> State<'a> {
1537
1538
ast::ExprStruct(ref path, ref fields, ref wth) => {
1539
try!(self.print_path(path, true));
1540
+ if fields.is_empty() && wth.is_none() {
1541
+ return;
1542
+ }
1543
try!(word(&mut self.s, "{"));
1544
try!(self.commasep_cmnt(
1545
Consistent,
@@ -1560,7 +1563,7 @@ impl<'a> State<'a> {
1560
1563
try!(self.print_expr(&**expr));
1561
1564
try!(self.end());
1562
1565
}
- _ => try!(word(&mut self.s, ","))
1566
+ _ => try!(word(&mut self.s, ",")),
1567
1568
try!(word(&mut self.s, "}"));
1569
0 commit comments