Skip to content

Commit 2cf2230

Browse files
committed
Merge pull request #596 from marcusklaas/where-indent
Fix brace indentation after where clause
2 parents fb6faed + d32245a commit 2cf2230

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

src/items.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,8 @@ impl<'a> FmtVisitor<'a> {
793793
let header_str = self.format_header(item_name, ident, vis);
794794
result.push_str(&header_str);
795795
result.push(';');
796-
return Some(result);
796+
797+
Some(result)
797798
}
798799

799800
fn format_struct_struct(&self,
@@ -968,8 +969,8 @@ impl<'a> FmtVisitor<'a> {
968969
terminator,
969970
Some(span.hi)));
970971
result.push_str(&where_clause_str);
971-
result.push_str(&self.block_indent.to_string(self.config));
972972
result.push('\n');
973+
result.push_str(&self.block_indent.to_string(self.config));
973974
result.push_str(opener);
974975
} else {
975976
result.push(' ');

tests/source/structs.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,9 @@ struct Foo<T>(TTTTTTTTTTTTTTTTT, // Foo
135135
TTTTTTTTTTTTTTTTTTT,
136136
// Qux (FIXME #572 - doc comment)
137137
UUUUUUUUUUUUUUUUUUU);
138+
139+
mod m {
140+
struct X<T> where T: Sized {
141+
a: T,
142+
}
143+
}

tests/target/structs.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,3 +141,11 @@ struct Foo<T>(TTTTTTTTTTTTTTTTT, // Foo
141141
TTTTTTTTTTTTTTTTTTT,
142142
// Qux (FIXME #572 - doc comment)
143143
UUUUUUUUUUUUUUUUUUU);
144+
145+
mod m {
146+
struct X<T>
147+
where T: Sized
148+
{
149+
a: T,
150+
}
151+
}

0 commit comments

Comments
 (0)