Skip to content

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

Merged
merged 14 commits into from
Oct 13, 2017
Merged

Refactorings #2042

merged 14 commits into from
Oct 13, 2017

Conversation

topecongiro
Copy link
Contributor

This PR consists of small refactorings.
The last commit is suspicious, rustfmt removes trailing comma from function call.

Copy link
Member

@nrc nrc left a 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) {
Copy link
Member

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)

Copy link
Contributor Author

@topecongiro topecongiro Oct 9, 2017

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...

@topecongiro
Copy link
Contributor Author

Thank you for the review! Fixed a typo.

@nrc nrc merged commit fc15e9f into rust-lang:master Oct 13, 2017
@topecongiro topecongiro deleted the refactoring branch July 21, 2019 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants