Skip to content

Commit 9b494f9

Browse files
committed
fix extra brace newline
1 parent a92a1cb commit 9b494f9

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

src/items.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ pub fn format_impl(
683683

684684
if is_impl_single_line(context, items, &result, &where_clause_str, item)? {
685685
result.push_str(&where_clause_str);
686-
if where_clause_str.contains('\n') || last_line_contains_single_line_comment(&result) {
686+
if last_line_contains_single_line_comment(&result) {
687687
result.push_str(&format!("{}{{{}}}", &sep, &sep));
688688
} else {
689689
result.push_str(" {}");

tests/source/configs/where_single_line/true.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ where
2222
fn lorem<Ipsum, Dolor, Sit, Amet>() -> T where Ipsum: Eq {
2323
// body
2424
}
25+
26+
unsafe impl Sync for Foo where (): Send {}

tests/target/configs/where_single_line/true.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ where
2323
}
2424

2525
fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
26-
where Ipsum: Eq {
26+
where
27+
Ipsum: Eq,
28+
{
2729
// body
2830
}
31+
32+
unsafe impl Sync for Foo
33+
where
34+
(): Send, {}

tests/target/impl.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ impl<T> Foo for T
2828
where
2929
// comment2
3030
// blah
31-
T: Clone,
32-
{
33-
}
31+
T: Clone, {}
3432

3533
// #1823
3634
default impl Trait for X {}

tests/target/impls.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ where
5050

5151
impl<T> Foo for Bar<T>
5252
where
53-
T: Baz,
54-
{
55-
}
53+
T: Baz, {}
5654

5755
impl<T> Foo for Bar<T>
5856
where
@@ -119,9 +117,7 @@ where
119117
pub impl<T, Z> Foo for Bar<T, Z>
120118
where
121119
T: Foo,
122-
Z: Baz,
123-
{
124-
}
120+
Z: Baz, {}
125121

126122
mod m {
127123
impl<T> PartialEq for S<T>
@@ -135,9 +131,7 @@ mod m {
135131

136132
impl<T> PartialEq for S<T>
137133
where
138-
T: PartialEq,
139-
{
140-
}
134+
T: PartialEq, {}
141135
}
142136

143137
impl<BorrowType, K, V, NodeType, HandleType>

0 commit comments

Comments
 (0)