Fix long field accesses not being broken onto separate lines

Fixes #512
This commit is contained in:
Markus Westerlind 2015-11-21 01:04:23 +01:00
parent bdc2e4fd3f
commit 465662a691
3 changed files with 23 additions and 2 deletions

View File

@ -194,8 +194,22 @@ fn rewrite_chain_expr(expr: &ast::Expr,
width,
offset)
}
ast::Expr_::ExprField(_, ref field) => Some(format!(".{}", field.node)),
ast::Expr_::ExprTupField(_, ref field) => Some(format!(".{}", field.node)),
ast::Expr_::ExprField(_, ref field) => {
let s = format!(".{}", field.node);
if s.len() <= width {
Some(s)
} else {
None
}
}
ast::Expr_::ExprTupField(_, ref field) => {
let s = format!(".{}", field.node);
if s.len() <= width {
Some(s)
} else {
None
}
}
_ => unreachable!(),
}
}

View File

@ -0,0 +1,3 @@
fn f() {
block_flow.base.stacking_relative_position_of_display_port = self.base.stacking_relative_position_of_display_port;
}

View File

@ -0,0 +1,4 @@
fn f() {
block_flow.base.stacking_relative_position_of_display_port =
self.base.stacking_relative_position_of_display_port;
}