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

Closure having long string in method argument is not formatted #5823

Closed
codingskynet opened this issue Jul 11, 2023 · 1 comment · May be fixed by #5825
Closed

Closure having long string in method argument is not formatted #5823

codingskynet opened this issue Jul 11, 2023 · 1 comment · May be fixed by #5825

Comments

@codingskynet
Copy link

codingskynet commented Jul 11, 2023

Case:

struct A;

impl A {
    fn b(&self, f: impl FnOnce()) {
        f()
    }
}

fn test() {
    let a = A;

    a.b(
      || {

   println!("sdflkdslkdkfmdslfdslkmdsflkmfdslkmfdsmlkfdsmlkfdslkfdsklfdslkmdsflfvdvjnlnlkccvjnxnlcvxjnlxcvjncvxjnkcvxjnxkcvz");
        }
    );
}

But this is not formatted.

Checked version of rustfmt: rustfmt 1.6.0-nightly (8ca44ef9 2023-07-10)

@codingskynet codingskynet changed the title Closure in method argument is not formatted Closure having long string in method argument is not formatted Jul 11, 2023
@ytmimi
Copy link
Contributor

ytmimi commented Jul 11, 2023

Thanks for reaching out, but this is a duplicate of #3863

@ytmimi ytmimi closed this as not planned Won't fix, can't repro, duplicate, stale Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants