@@ -195,6 +195,7 @@ enum ChainItemKind {
195195 StructField ( symbol:: Ident ) ,
196196 TupleField ( symbol:: Ident , bool ) ,
197197 Await ,
198+ Yield ,
198199 Comment ( String , CommentPosition ) ,
199200}
200201
@@ -206,6 +207,7 @@ impl ChainItemKind {
206207 | ChainItemKind :: StructField ( ..)
207208 | ChainItemKind :: TupleField ( ..)
208209 | ChainItemKind :: Await
210+ | ChainItemKind :: Yield
209211 | ChainItemKind :: Comment ( ..) => false ,
210212 }
211213 }
@@ -260,6 +262,10 @@ impl ChainItemKind {
260262 let span = mk_sp ( nested. span . hi ( ) , expr. span . hi ( ) ) ;
261263 ( ChainItemKind :: Await , span)
262264 }
265+ ast:: ExprKind :: Yield ( ast:: YieldKind :: Postfix ( ref nested) ) => {
266+ let span = mk_sp ( nested. span . hi ( ) , expr. span . hi ( ) ) ;
267+ ( ChainItemKind :: Yield , span)
268+ }
263269 _ => {
264270 return (
265271 ChainItemKind :: Parent {
@@ -307,6 +313,7 @@ impl Rewrite for ChainItem {
307313 rewrite_ident( context, ident)
308314 ) ,
309315 ChainItemKind :: Await => ".await" . to_owned ( ) ,
316+ ChainItemKind :: Yield => ".yield" . to_owned ( ) ,
310317 ChainItemKind :: Comment ( ref comment, _) => {
311318 rewrite_comment ( comment, false , shape, context. config ) ?
312319 }
@@ -509,7 +516,8 @@ impl Chain {
509516 } ) ,
510517 ast:: ExprKind :: Field ( ref subexpr, _)
511518 | ast:: ExprKind :: Try ( ref subexpr)
512- | ast:: ExprKind :: Await ( ref subexpr, _) => Some ( SubExpr {
519+ | ast:: ExprKind :: Await ( ref subexpr, _)
520+ | ast:: ExprKind :: Yield ( ast:: YieldKind :: Postfix ( ref subexpr) ) => Some ( SubExpr {
513521 expr : Self :: convert_try ( subexpr, context) ,
514522 is_method_call_receiver : false ,
515523 } ) ,
0 commit comments