3636pub use crate :: types:: Context ;
3737use client:: Client ;
3838use futures:: stream:: { Stream , StreamExt } ;
39- use genawaiter:: { sync:: gen, yield_} ;
4039pub use lambda_attributes:: lambda;
4140use serde:: { Deserialize , Serialize } ;
4241use std:: {
@@ -163,17 +162,18 @@ where
163162}
164163
165164fn incoming ( client : & Client ) -> impl Stream < Item = Result < http:: Response < hyper:: Body > , Error > > + ' _ {
166- gen ! ( {
165+ async_stream :: stream! {
167166 loop {
168167 let req = NextEventRequest . into_req( ) . expect( "Unable to construct request" ) ;
169- yield_!( client. call( req) . await )
168+ let res = client. call( req) . await ;
169+ yield res;
170170 }
171- } )
171+ }
172172}
173173
174174async fn run_inner < A , B , F > (
175175 client : & Client ,
176- incoming : impl Stream < Item = Result < http:: Response < hyper:: Body > , Error > > + Unpin ,
176+ incoming : impl Stream < Item = Result < http:: Response < hyper:: Body > , Error > > ,
177177 handler : & mut F ,
178178) -> Result < ( ) , Error >
179179where
@@ -182,7 +182,8 @@ where
182182 A : for < ' de > Deserialize < ' de > ,
183183 B : Serialize ,
184184{
185- let mut incoming = incoming;
185+ tokio:: pin!( incoming) ;
186+
186187 while let Some ( event) = incoming. next ( ) . await {
187188 let event = event?;
188189 let ( parts, body) = event. into_parts ( ) ;
0 commit comments