@@ -195,6 +195,7 @@ enum ChainItemKind {
195195 StructField ( symbol:: Ident ) ,
196196 TupleField ( symbol:: Ident , bool ) ,
197197 Await ,
198+ Use ,
198199 Yield ,
199200 Comment ( String , CommentPosition ) ,
200201}
@@ -207,6 +208,7 @@ impl ChainItemKind {
207208 | ChainItemKind :: StructField ( ..)
208209 | ChainItemKind :: TupleField ( ..)
209210 | ChainItemKind :: Await
211+ | ChainItemKind :: Use
210212 | ChainItemKind :: Yield
211213 | ChainItemKind :: Comment ( ..) => false ,
212214 }
@@ -262,6 +264,10 @@ impl ChainItemKind {
262264 let span = mk_sp ( nested. span . hi ( ) , expr. span . hi ( ) ) ;
263265 ( ChainItemKind :: Await , span)
264266 }
267+ ast:: ExprKind :: Use ( ref nested, _) => {
268+ let span = mk_sp ( nested. span . hi ( ) , expr. span . hi ( ) ) ;
269+ ( ChainItemKind :: Use , span)
270+ }
265271 ast:: ExprKind :: Yield ( ast:: YieldKind :: Postfix ( ref nested) ) => {
266272 let span = mk_sp ( nested. span . hi ( ) , expr. span . hi ( ) ) ;
267273 ( ChainItemKind :: Yield , span)
@@ -313,6 +319,7 @@ impl Rewrite for ChainItem {
313319 rewrite_ident( context, ident)
314320 ) ,
315321 ChainItemKind :: Await => ".await" . to_owned ( ) ,
322+ ChainItemKind :: Use => ".use" . to_owned ( ) ,
316323 ChainItemKind :: Yield => ".yield" . to_owned ( ) ,
317324 ChainItemKind :: Comment ( ref comment, _) => {
318325 rewrite_comment ( comment, false , shape, context. config ) ?
@@ -517,6 +524,7 @@ impl Chain {
517524 ast:: ExprKind :: Field ( ref subexpr, _)
518525 | ast:: ExprKind :: Try ( ref subexpr)
519526 | ast:: ExprKind :: Await ( ref subexpr, _)
527+ | ast:: ExprKind :: Use ( ref subexpr, _)
520528 | ast:: ExprKind :: Yield ( ast:: YieldKind :: Postfix ( ref subexpr) ) => Some ( SubExpr {
521529 expr : Self :: convert_try ( subexpr, context) ,
522530 is_method_call_receiver : false ,
0 commit comments