-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Format PatternMatchOr
#6905
Format PatternMatchOr
#6905
Conversation
Now clippy complains about And look at that amount of lines removed |
CodSpeed Performance ReportMerging #6905 will not alter performanceComparing Summary
|
Finally, our last syntax is now implemented. Yes, we can remove that function. |
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.
Neat! Thanks for working on the last pattern.
@@ -167,45 +165,6 @@ pub fn format_node<'a>( | |||
Ok(formatted) | |||
} | |||
|
|||
pub(crate) struct NotYetImplementedCustomText<'a> { |
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.
Nice!
let leading_value_comments = comments.leading(pattern); | ||
// Format the expressions leading comments **before** the operator | ||
if leading_value_comments.is_empty() { | ||
write!(f, [in_parentheses_only_soft_line_break_or_space()])?; |
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.
Using the in_parentheses_only
builder here seems correct but isn't sufficient without using optional_parentheses
in the match case formatting. I created an issue to track that work #6933
53efe4d
to
9b22f0b
Compare
This PR improves the similarity index for CPython from cpython 0.76076 to 0.76081 |
9b22f0b
to
f5f7ddf
Compare
Summary
There was only one case where I couldn't figure it out how to format properly, which is the following
That code is being formatted to this
But it should be formatted to this
Closes #6643
Test Plan
cargo test