We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
} else {
Code:
fn main() { if true { // Create a guard. let guard = create_guard(); // The guard goes out of scope. } else { } }
After rustfmt:
Perhaps all lines within blocks (even comments) should always be indented more than the lines with block boundaries?
The text was updated successfully, but these errors were encountered:
This is intended behavior (cc #1575, #1619). You can set format_if_else_cond_comment to false to indent the comment.
format_if_else_cond_comment
false
Sorry, something went wrong.
@topecongiro Would it make sense for rustfmt to simply leave indentation of such comments intact?
To illustrate, I'm suggesting that rustfmt formats the following:
if true { foo(); // a } else if true { bar(); // b } else if true { baz(); // c } else { quux(); }
Into this:
That strategy would do the right thing in almost all cases.
You can set format_if_else_cond_comment to false to indent the comment.
It looks like this option has been removed from rustfmt and now there is no way to override this behaviour.
rustfmt
No branches or pull requests
Code:
After rustfmt:
Perhaps all lines within blocks (even comments) should always be indented more than the lines with block boundaries?
The text was updated successfully, but these errors were encountered: