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

Fix #5823 #5825

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

codingskynet
Copy link

close #5823

I solved the problem very simply. But, I do not know rustfmt very well, so I am not sure that the change is suitable and proper. Please give me advice or editing for more proper solution is welcome.

@ytmimi
Copy link
Contributor

ytmimi commented Jul 11, 2023

@codingskynet thanks for submitting a PR.

Unfortunately, rustfmt's strong stability guarantee prevents us from accepting this PR as it's currently written since it would modify existing formatting. In this case, the existing formatting is that rustfmt leaves the call chain unmodified. I understand if that sounds bizarre to you. @calebcartwright is this something we could move forward with if it were version gated?

I also want to highlight that you can currently format your test case by setting format_strings=true (which requires nighlty)

Input:

fn issue_5823() {
    a.b(
      |    | {
     let c = "very long text for formatting test of very long text, frequently used on logging and other situations";
        }
    );
}

output:

fn issue_5823() {
    a.b(|| {
        let c = "very long text for formatting test of very long text, frequently used on logging \
                 and other situations";
    });
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Closure having long string in method argument is not formatted
2 participants