Use precise width when rewriting else if
This commit is contained in:
parent
d0a094eefb
commit
819a13030f
@ -986,12 +986,7 @@ impl<'a> Rewrite for ControlFlow<'a> {
|
||||
block_str);
|
||||
|
||||
if let Some(else_block) = self.else_block {
|
||||
// Since this is an else block, we should not indent for the assignment preceding
|
||||
// the original if, so set shape.offset to shape.indent.alignment.
|
||||
let shape = Shape {
|
||||
offset: shape.indent.alignment,
|
||||
..shape
|
||||
};
|
||||
let shape = Shape::indented(shape.indent, context.config);
|
||||
let mut last_in_chain = false;
|
||||
let rewrite = match else_block.node {
|
||||
// If the else expression is another if-else expression, prevent it
|
||||
|
Loading…
x
Reference in New Issue
Block a user