-
Notifications
You must be signed in to change notification settings - Fork 933
Fix/Inconsistent Struct Body Opening Brace Placement After Where Clause #5508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 6 commits
0ee1308
2e46b4c
58e2a54
b3e3651
b5323ca
0c0fb58
254c829
088369e
f526382
c5098f8
5cd84e1
64a2321
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// rustfmt-version: One | ||
|
||
struct EmptyBody<T> | ||
where T: Eq { | ||
} | ||
|
||
struct LineComment<T> | ||
where T: Eq { | ||
// body | ||
} | ||
|
||
struct MultiLineComment<T> | ||
where T: Eq { | ||
/* | ||
Multiline | ||
comment. | ||
*/ | ||
} | ||
|
||
struct BlockComment<T> | ||
where T: Eq { | ||
/* block comment */ | ||
} | ||
|
||
struct HasBody<T> | ||
where T: Eq { | ||
x: T | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// rustfmt-version: Two | ||
|
||
struct EmptyBody<T> | ||
where T: Eq { | ||
} | ||
|
||
struct LineComment<T> | ||
where T: Eq { | ||
// body | ||
} | ||
|
||
struct MultiLineComment<T> | ||
where T: Eq { | ||
/* | ||
Multiline | ||
comment. | ||
*/ | ||
} | ||
|
||
struct BlockComment<T> | ||
where T: Eq { | ||
/* block comment */ | ||
} | ||
|
||
struct HasBody<T> | ||
where T: Eq { | ||
x: T | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// rustfmt-version: One | ||
|
||
struct EmptyBody<T> | ||
where | ||
T: Eq, {} | ||
|
||
struct LineComment<T> | ||
where | ||
T: Eq, { | ||
// body | ||
} | ||
|
||
struct MultiLineComment<T> | ||
where | ||
T: Eq, { | ||
/* | ||
Multiline | ||
comment. | ||
*/ | ||
} | ||
|
||
struct BlockComment<T> | ||
where | ||
T: Eq, {/* block comment */} | ||
|
||
struct HasBody<T> | ||
where | ||
T: Eq, | ||
{ | ||
x: T, | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// rustfmt-version: Two | ||
|
||
struct EmptyBody<T> | ||
where | ||
T: Eq, | ||
{} | ||
|
||
struct LineComment<T> | ||
where | ||
T: Eq, | ||
{ | ||
// body | ||
} | ||
|
||
struct MultiLineComment<T> | ||
where | ||
T: Eq, | ||
{ | ||
/* | ||
Multiline | ||
comment. | ||
*/ | ||
} | ||
|
||
struct BlockComment<T> | ||
where | ||
T: Eq, | ||
{/* block comment */} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similarly, I think single line block comments should also follow the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a way to specifically check for block comments? If so, I the solution shouldn't be too complicated. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To my knowledge there isn't a standalone function that can be used for something like that. However you could check that using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ytmimi Done! Now empty There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fantastic. Thank you for making those changes. I'll give this another review in the coming days! |
||
|
||
struct HasBody<T> | ||
where | ||
T: Eq, | ||
{ | ||
x: T, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Subjective, but I think this should stay on the same line as the bound, Essentially following the
version=One
formatting.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okok. I'll proceed to fix it