Put a space between nested tuple field
This commit is contained in:
parent
b79094262f
commit
b63e3aaa83
@ -454,7 +454,13 @@ fn rewrite_chain_subexpr(expr: &ast::Expr,
|
||||
rewrite_method_call(method_name.node, types, expressions, span, context, shape)
|
||||
}
|
||||
ast::ExprKind::Field(_, ref field) => rewrite_element(format!(".{}", field.node)),
|
||||
ast::ExprKind::TupField(_, ref field) => rewrite_element(format!(".{}", field.node)),
|
||||
ast::ExprKind::TupField(ref expr, ref field) => {
|
||||
let space = match expr.node {
|
||||
ast::ExprKind::TupField(..) => " ",
|
||||
_ => "",
|
||||
};
|
||||
rewrite_element(format!("{}.{}", space, field.node))
|
||||
}
|
||||
ast::ExprKind::Try(_) => rewrite_element(String::from("?")),
|
||||
_ => unreachable!(),
|
||||
}
|
||||
|
@ -12,6 +12,9 @@ fn foo() {
|
||||
let b = (// This is a comment
|
||||
b, // Comment
|
||||
b /* Trailing comment */);
|
||||
|
||||
// #1063
|
||||
foo(x.0 .0);
|
||||
}
|
||||
|
||||
fn a() {
|
||||
|
@ -12,6 +12,9 @@ fn foo() {
|
||||
let b = (// This is a comment
|
||||
b, // Comment
|
||||
b /* Trailing comment */);
|
||||
|
||||
// #1063
|
||||
foo(x.0 .0);
|
||||
}
|
||||
|
||||
fn a() {
|
||||
|
Loading…
Reference in New Issue
Block a user