Makes brace behavior consistent with empty bodies for traits and impls
Adds a newline before the last brace on impls without a body if the first brace is also on a newline
This commit is contained in:
parent
ac6871f376
commit
2727d41ddb
3 changed files with 12 additions and 8 deletions
|
|
@ -755,11 +755,10 @@ pub fn format_impl(
|
|||
result.push_str(&inner_indent_str);
|
||||
result.push_str(visitor.buffer.to_string().trim());
|
||||
result.push_str(&outer_indent_str);
|
||||
}
|
||||
|
||||
if result.ends_with('{') && !context.config.empty_item_single_line() {
|
||||
} else if need_newline || !context.config.empty_item_single_line() {
|
||||
result.push_str(&sep);
|
||||
}
|
||||
|
||||
result.push('}');
|
||||
|
||||
Some(result)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue