@@ -10,8 +10,8 @@ use proc_macro2::{Span, TokenStream as TokenStream2, TokenTree as TokenTree2};
10
10
use quote:: { quote, ToTokens } ;
11
11
use syn:: {
12
12
fold:: { self , Fold } ,
13
- token, ArgCaptured , Error , Expr , ExprForLoop , ExprMacro , ExprYield , FnArg , FnDecl , Ident , Item ,
14
- ItemFn , Pat , PatIdent , ReturnType , TypeTuple ,
13
+ token, ArgCaptured , Error , Expr , ExprCall , ExprForLoop , ExprMacro , ExprYield , FnArg , FnDecl ,
14
+ Ident , Item , ItemFn , Pat , PatIdent , ReturnType , TypeTuple ,
15
15
} ;
16
16
17
17
#[ macro_use]
@@ -298,14 +298,9 @@ impl Expand {
298
298
if self . 0 == Stream && expr. mac . path . is_ident ( "await" ) {
299
299
return self . expand_await_macros ( expr) ;
300
300
} else if expr. mac . path . is_ident ( "async_stream_block" ) {
301
- // FIXME: When added Parse impl for ExprCall, replace `if let ..` + `unreachable!()`
302
- // with `let` + `.unwrap()`
303
- if let Ok ( Expr :: Call ( mut e) ) = syn:: parse ( async_stream_block ( expr. mac . tts . into ( ) ) ) {
304
- e. attrs . append ( & mut expr. attrs ) ;
305
- return Expr :: Call ( e) ;
306
- } else {
307
- unreachable ! ( )
308
- }
301
+ let mut e: ExprCall = syn:: parse ( async_stream_block ( expr. mac . tts . into ( ) ) ) . unwrap ( ) ;
302
+ e. attrs . append ( & mut expr. attrs ) ;
303
+ return Expr :: Call ( e) ;
309
304
}
310
305
311
306
Expr :: Macro ( expr)
0 commit comments