Open
Description
When the body of a struct is empty or it only contains comments, the opening brace of the struct body is placed on the same line as the where clause. If the struct body is not empty, the opening brace is placed on a newline.
No configuration values are needed, and I was using rustfmt 1.5.1-nightly (841b4542 2022-08-17)
when I came across this.
Input
struct EmptyBody<T>
where T: Eq {
}
struct LineComment<T>
where T: Eq {
// body
}
struct BlockComment<T>
where T: Eq {
/* block comment */
}
struct HasBody<T>
where T: Eq {
x: T
}
Output
struct EmptyBody<T>
where
T: Eq, {}
struct LineComment<T>
where
T: Eq, {
// body
}
struct BlockComment<T>
where
T: Eq, {/* block comment */}
struct HasBody<T>
where
T: Eq,
{
x: T,
}