Skip to content

Conversation

tspiteri
Copy link
Contributor

Inside multiline conditions in nested else statements, remove the alignment due to the let binding before the original if statement. Fixes #1239.

width: shape.width,
indent: Indent {
block_indent: shape.indent.block_indent,
alignment: 0,
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this is quite right, because the if/else could be nested inside an expression where the alignment should not be reset

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you have an example in mind? Because as I understand it, the } else if ... { part will always move back to the block indent, which is retained.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I think you're right, and you're passing the test suite, so it seems good.

@nrc nrc merged commit 5925a1a into rust-lang:master Feb 1, 2017
@nrc
Copy link
Member

nrc commented Feb 1, 2017

Thank you!

@tspiteri tspiteri deleted the let-if-else branch February 1, 2017 08:40
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