Skip to content

Disallow combining a method call with prefix or suffix #2730

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 3 commits into from
May 23, 2018

Conversation

topecongiro
Copy link
Contributor

Closes #2704.

);
// We should combine a small callee with an argument.
bar(vec![22]
.into_iter()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should probably not combine in this case - I feel like the benefit of uniformity outweights the slight ugliness of the floating second line. Also, I think that the floating second line is worse if it beings with punctuation, rather than a name. E.g.,

// pretty bad
x
    .foo
    .bar

// not as bad
x(
    foo.bar
)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And the opening parens make this case look better too - similar to braces in a block (probably more important than the punctuation vs identifier distinction).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I though that we decided to combine a short function call and a single argument in #2178, but no?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, we did, sorry (I'm not 100% sure I agree with my old self, but lets try it out).

@topecongiro
Copy link
Contributor Author

The test failure is not related to this PR (poor clippy).

@nrc nrc merged commit 353816c into rust-lang:master May 23, 2018
@topecongiro topecongiro deleted the issue-2704 branch May 23, 2018 08:55
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