Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Pretty Printing 2: Electric Boogaloo #407

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/data/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,11 @@ fn write_struct_type(struct_type: &StructType, f: &mut Formatter) -> fmt::Result
write!(f, "{}", name)?;
}
StructType::Anonymous(members) => {
write!(f, "{{ ")?;
write!(f, "{{")?;
for member in members.iter() {
writeln!(f, "{};", member)?;
writeln!(f, " {};", member)?;
}
write!(f, " }}")?;
write!(f, "}}")?;
}
}
Ok(())
Expand Down Expand Up @@ -481,7 +481,7 @@ pub(crate) mod tests {

#[test]
fn test_big_one() {
assert_decl_display("struct { int i; } S;", "struct { int i; } S;");
assert_decl_display("struct { int i; } S;", "struct { int i;\n} S;");
pythongirl325 marked this conversation as resolved.
Show resolved Hide resolved
assert_decl_display("int f();", "int f();");
assert_decl_display("int bar;", "int bar;");
assert_decl_display("int *foo;", "int *foo;");
Expand Down