Skip to content

Commit 8a4782b

Browse files
sasurau4calebcartwright
authored andcommitted
Remove nested flag from TupleField
1 parent 28799b8 commit 8a4782b

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/formatting/chains.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ enum ChainItemKind {
119119
Vec<ptr::P<ast::Expr>>,
120120
),
121121
StructField(symbol::Ident),
122-
TupleField(symbol::Ident, bool),
122+
TupleField(symbol::Ident),
123123
Await,
124124
Comment(String, CommentPosition),
125125
}
@@ -171,7 +171,7 @@ impl ChainItemKind {
171171
}
172172
ast::ExprKind::Field(ref nested, field) => {
173173
let kind = if Self::is_tup_field_access(expr) {
174-
ChainItemKind::TupleField(field, Self::is_tup_field_access(nested))
174+
ChainItemKind::TupleField(field)
175175
} else {
176176
ChainItemKind::StructField(field)
177177
};
@@ -199,12 +199,9 @@ impl Rewrite for ChainItem {
199199
ChainItemKind::MethodCall(ref segment, ref types, ref exprs) => {
200200
Self::rewrite_method_call(segment.ident, types, exprs, self.span, context, shape)?
201201
}
202-
ChainItemKind::StructField(ident) => format!(".{}", rewrite_ident(context, ident)),
203-
ChainItemKind::TupleField(ident, nested) => format!(
204-
"{}.{}",
205-
if nested { " " } else { "" },
206-
rewrite_ident(context, ident)
207-
),
202+
ChainItemKind::StructField(ident) | ChainItemKind::TupleField(ident) => {
203+
format!(".{}", rewrite_ident(context, ident))
204+
}
208205
ChainItemKind::Await => ".await".to_owned(),
209206
ChainItemKind::Comment(ref comment, _) => {
210207
rewrite_comment(comment, false, shape, context.config)?

0 commit comments

Comments
 (0)