@@ -94,7 +94,7 @@ pub fn rewrite_chain(mut expr: &ast::Expr,
94
94
95
95
let fits_single_line = !veto_single_line &&
96
96
match subexpr_list[ 0 ] . node {
97
- ast:: Expr_ :: ExprMethodCall ( ref method_name, ref types, ref expressions)
97
+ ast:: ExprKind :: MethodCall ( ref method_name, ref types, ref expressions)
98
98
if context. config . chains_overflow_last => {
99
99
let len = rewrites. len ( ) ;
100
100
let ( init, last) = rewrites. split_at_mut ( len - 1 ) ;
@@ -150,28 +150,28 @@ pub fn rewrite_chain(mut expr: &ast::Expr,
150
150
// parens, braces and brackets in its idiomatic formatting.
151
151
fn is_block_expr ( expr : & ast:: Expr , repr : & str ) -> bool {
152
152
match expr. node {
153
- ast:: Expr_ :: ExprStruct ( ..) |
154
- ast:: Expr_ :: ExprWhile ( ..) |
155
- ast:: Expr_ :: ExprWhileLet ( ..) |
156
- ast:: Expr_ :: ExprIf ( ..) |
157
- ast:: Expr_ :: ExprIfLet ( ..) |
158
- ast:: Expr_ :: ExprBlock ( ..) |
159
- ast:: Expr_ :: ExprLoop ( ..) |
160
- ast:: Expr_ :: ExprForLoop ( ..) |
161
- ast:: Expr_ :: ExprMatch ( ..) => repr. contains ( '\n' ) ,
162
- ast:: Expr_ :: ExprParen ( ref expr) |
163
- ast:: Expr_ :: ExprBinary ( _, _, ref expr) |
164
- ast:: Expr_ :: ExprIndex ( _, ref expr) |
165
- ast:: Expr_ :: ExprUnary ( _, ref expr) => is_block_expr ( expr, repr) ,
153
+ ast:: ExprKind :: Struct ( ..) |
154
+ ast:: ExprKind :: While ( ..) |
155
+ ast:: ExprKind :: WhileLet ( ..) |
156
+ ast:: ExprKind :: If ( ..) |
157
+ ast:: ExprKind :: IfLet ( ..) |
158
+ ast:: ExprKind :: Block ( ..) |
159
+ ast:: ExprKind :: Loop ( ..) |
160
+ ast:: ExprKind :: ForLoop ( ..) |
161
+ ast:: ExprKind :: Match ( ..) => repr. contains ( '\n' ) ,
162
+ ast:: ExprKind :: Paren ( ref expr) |
163
+ ast:: ExprKind :: Binary ( _, _, ref expr) |
164
+ ast:: ExprKind :: Index ( _, ref expr) |
165
+ ast:: ExprKind :: Unary ( _, ref expr) => is_block_expr ( expr, repr) ,
166
166
_ => false ,
167
167
}
168
168
}
169
169
170
170
fn pop_expr_chain ( expr : & ast:: Expr ) -> Option < & ast:: Expr > {
171
171
match expr. node {
172
- ast:: Expr_ :: ExprMethodCall ( _, _, ref expressions) => Some ( & expressions[ 0 ] ) ,
173
- ast:: Expr_ :: ExprTupField ( ref subexpr, _) |
174
- ast:: Expr_ :: ExprField ( ref subexpr, _) => Some ( subexpr) ,
172
+ ast:: ExprKind :: MethodCall ( _, _, ref expressions) => Some ( & expressions[ 0 ] ) ,
173
+ ast:: ExprKind :: TupField ( ref subexpr, _) |
174
+ ast:: ExprKind :: Field ( ref subexpr, _) => Some ( subexpr) ,
175
175
_ => None ,
176
176
}
177
177
}
@@ -183,7 +183,7 @@ fn rewrite_chain_expr(expr: &ast::Expr,
183
183
offset : Indent )
184
184
-> Option < String > {
185
185
match expr. node {
186
- ast:: Expr_ :: ExprMethodCall ( ref method_name, ref types, ref expressions) => {
186
+ ast:: ExprKind :: MethodCall ( ref method_name, ref types, ref expressions) => {
187
187
let inner = & RewriteContext { block_indent : offset, ..* context } ;
188
188
rewrite_method_call ( method_name. node ,
189
189
types,
@@ -193,15 +193,15 @@ fn rewrite_chain_expr(expr: &ast::Expr,
193
193
width,
194
194
offset)
195
195
}
196
- ast:: Expr_ :: ExprField ( _, ref field) => {
196
+ ast:: ExprKind :: Field ( _, ref field) => {
197
197
let s = format ! ( ".{}" , field. node) ;
198
198
if s. len ( ) <= width {
199
199
Some ( s)
200
200
} else {
201
201
None
202
202
}
203
203
}
204
- ast:: Expr_ :: ExprTupField ( _, ref field) => {
204
+ ast:: ExprKind :: TupField ( _, ref field) => {
205
205
let s = format ! ( ".{}" , field. node) ;
206
206
if s. len ( ) <= width {
207
207
Some ( s)
@@ -216,7 +216,7 @@ fn rewrite_chain_expr(expr: &ast::Expr,
216
216
// Determines we can continue formatting a given expression on the same line.
217
217
fn is_continuable ( expr : & ast:: Expr ) -> bool {
218
218
match expr. node {
219
- ast:: Expr_ :: ExprPath ( ..) => true ,
219
+ ast:: ExprKind :: Path ( ..) => true ,
220
220
_ => false ,
221
221
}
222
222
}
0 commit comments