-
Notifications
You must be signed in to change notification settings - Fork 931
Refactorings #2042
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
Refactorings #2042
Conversation
rustfmt removes trailing comma from a function call. This could be a bug.
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.
looks good, thanks! I had one question inline
src/chains.rs
Outdated
@@ -198,7 +198,7 @@ pub fn rewrite_chain(expr: &ast::Expr, context: &RewriteContext, shape: Shape) - | |||
if let Some(rw) = rewrite_chain_subexpr(last_subexpr, total_span, context, shape) { | |||
let line_count = rw.lines().count(); | |||
let fits_single_line = almost_total + first_line_width(&rw) <= one_line_budget; | |||
if (line_count >= 5 && fits_single_line) || extend_last_subexr { | |||
if fits_single_line && (line_count >= 5 && fits_single_line || extend_last_subexr) { |
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.
Should this be fits_single_line && (line_count >= 5 || extend_last_subexr)
(I think they are equivalent)
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.
Yes, just a classic "Fix a typo" commit introducing another typo...
Thank you for the review! Fixed a typo. |
This PR consists of small refactorings.
The last commit is suspicious, rustfmt removes trailing comma from function call.