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

rustfmt doesn't format this code #4072

Closed
TeXitoi opened this issue Mar 5, 2020 · 2 comments
Closed

rustfmt doesn't format this code #4072

TeXitoi opened this issue Mar 5, 2020 · 2 comments

Comments

@TeXitoi
Copy link

TeXitoi commented Mar 5, 2020

Here a case where rustfmt doesn't do anything. I tried to simplify to the maximum the use case. If you remove (almost) any character, rustfmt does its job.

fn main() {
    n()
            .ser(a
            .app(
                default().limieeeeeeeeeeeeeeeeet().error_handler(|err, req| {
                    error!("Invalid model    req                      ", "error" => err.to_string());
                }
            )
        )
    )
}

Tested with the latest nightly: rustfmt 1.4.12-nightly (9f53665 2020-02-10)

@calebcartwright
Copy link
Member

I believe this is due to a known existing issue with chains wherein if the formatted result for any individual chain element exceeds the max_width value then rustmft leaves the entire original chain snippet as is.

Refs (and likely duplicate of) #3863

@topecongiro
Copy link
Contributor

@TeXitoi @calebcartwright Thanks, this is indeed a duplicate of #3863.

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

No branches or pull requests

3 participants