Skip to content

Commit

Permalink
Add test for empty tuple struct with comment
Browse files Browse the repository at this point in the history
  • Loading branch information
topecongiro committed Apr 14, 2017
1 parent 4362e8a commit 1cd3287
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,7 @@ fn format_tuple_struct(context: &RewriteContext,
result.push('(');
let snippet = context.snippet(mk_sp(body_lo, context.codemap.span_before(span, ")")));
if snippet.is_empty() {
//
// `struct S ()`
} else if snippet
.trim_right_matches(&[' ', '\t'][..])
.ends_with('\n') {
Expand Down
2 changes: 1 addition & 1 deletion tests/source/structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ struct Foo {

}
struct Foo { /* comment */ }
struct Foo();
struct Foo( /* comment */ );

struct LongStruct {
a: A,
Expand Down
2 changes: 1 addition & 1 deletion tests/target/structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ struct Foo {
// trailing space ->
}
struct Foo { /* comment */ }
struct Foo();
struct Foo( /* comment */ );

struct LongStruct {
a: A,
Expand Down

0 comments on commit 1cd3287

Please sign in to comment.