@@ -195,6 +195,7 @@ enum ChainItemKind {
195
195
StructField ( symbol:: Ident ) ,
196
196
TupleField ( symbol:: Ident , bool ) ,
197
197
Await ,
198
+ Use ,
198
199
Yield ,
199
200
Comment ( String , CommentPosition ) ,
200
201
}
@@ -207,6 +208,7 @@ impl ChainItemKind {
207
208
| ChainItemKind :: StructField ( ..)
208
209
| ChainItemKind :: TupleField ( ..)
209
210
| ChainItemKind :: Await
211
+ | ChainItemKind :: Use
210
212
| ChainItemKind :: Yield
211
213
| ChainItemKind :: Comment ( ..) => false ,
212
214
}
@@ -262,6 +264,10 @@ impl ChainItemKind {
262
264
let span = mk_sp ( nested. span . hi ( ) , expr. span . hi ( ) ) ;
263
265
( ChainItemKind :: Await , span)
264
266
}
267
+ ast:: ExprKind :: Use ( ref nested, _) => {
268
+ let span = mk_sp ( nested. span . hi ( ) , expr. span . hi ( ) ) ;
269
+ ( ChainItemKind :: Use , span)
270
+ }
265
271
ast:: ExprKind :: Yield ( ast:: YieldKind :: Postfix ( ref nested) ) => {
266
272
let span = mk_sp ( nested. span . hi ( ) , expr. span . hi ( ) ) ;
267
273
( ChainItemKind :: Yield , span)
@@ -313,6 +319,7 @@ impl Rewrite for ChainItem {
313
319
rewrite_ident( context, ident)
314
320
) ,
315
321
ChainItemKind :: Await => ".await" . to_owned ( ) ,
322
+ ChainItemKind :: Use => ".use" . to_owned ( ) ,
316
323
ChainItemKind :: Yield => ".yield" . to_owned ( ) ,
317
324
ChainItemKind :: Comment ( ref comment, _) => {
318
325
rewrite_comment ( comment, false , shape, context. config ) ?
@@ -517,6 +524,7 @@ impl Chain {
517
524
ast:: ExprKind :: Field ( ref subexpr, _)
518
525
| ast:: ExprKind :: Try ( ref subexpr)
519
526
| ast:: ExprKind :: Await ( ref subexpr, _)
527
+ | ast:: ExprKind :: Use ( ref subexpr, _)
520
528
| ast:: ExprKind :: Yield ( ast:: YieldKind :: Postfix ( ref subexpr) ) => Some ( SubExpr {
521
529
expr : Self :: convert_try ( subexpr, context) ,
522
530
is_method_call_receiver : false ,
0 commit comments