Add test for empty tuple struct with comment

This commit is contained in:
topecongiro 2017-04-14 22:39:20 +09:00 committed by Seiichi Uchida
parent 2e00c117e5
commit 93dae1a34d
3 changed files with 3 additions and 3 deletions

View File

@ -1029,7 +1029,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') {

View File

@ -166,7 +166,7 @@ struct Foo {
}
struct Foo { /* comment */ }
struct Foo();
struct Foo( /* comment */ );
struct LongStruct {
a: A,

View File

@ -170,7 +170,7 @@ struct Foo {
// trailing space ->
}
struct Foo { /* comment */ }
struct Foo();
struct Foo( /* comment */ );
struct LongStruct {
a: A,