Skip to content
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

Allow first child to stay on the same line with block parent when rewriting chain #1576

Merged
merged 5 commits into from
May 23, 2017

Conversation

topecongiro
Copy link
Contributor

rustfmt splits chain into multiline when the length of chain exceeds
`chain_one_line_max`. However, currenly this rule only applies when the chain
has more than one child. This can lead to unexpected long chain if the parent
is long. This commit adds heuristic that if the length of parent is longer
than the half of `chain_one_line_max` we use multiline even if there is
only a single child.
@nrc
Copy link
Member

nrc commented May 23, 2017

Nice, thank you!

@nrc nrc merged commit cb464a9 into rust-lang:master May 23, 2017
@topecongiro topecongiro deleted the chain/float-first-child branch May 23, 2018 15:23
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