Merge pull request #635 from Marwes/long_field_access

Fix long field accesses not being broken onto separate lines
This commit is contained in:
Marcus Klaas de Vries 2015-11-21 21:04:34 +01:00
commit 2a159e05ac
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;
}