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:: {
@@ -179,17 +178,18 @@ where
179178}
180179
181180fn incoming ( client : & Client ) -> impl Stream < Item = Result < http:: Response < hyper:: Body > , Error > > + ' _ {
182- gen ! ( {
181+ async_stream :: stream! {
183182 loop {
184183 let req = NextEventRequest . into_req( ) . expect( "Unable to construct request" ) ;
185- yield_!( client. call( req) . await )
184+ let res = client. call( req) . await ;
185+ yield res;
186186 }
187- } )
187+ }
188188}
189189
190190async fn run_inner < A , B , F > (
191191 client : & Client ,
192- incoming : impl Stream < Item = Result < http:: Response < hyper:: Body > , Error > > + Unpin ,
192+ incoming : impl Stream < Item = Result < http:: Response < hyper:: Body > , Error > > ,
193193 handler : & mut F ,
194194) -> Result < ( ) , Error >
195195where
@@ -198,7 +198,8 @@ where
198198 A : for < ' de > Deserialize < ' de > ,
199199 B : Serialize ,
200200{
201- let mut incoming = incoming;
201+ tokio:: pin!( incoming) ;
202+
202203 while let Some ( event) = incoming. next ( ) . await {
203204 let event = event?;
204205 let ( parts, body) = event. into_parts ( ) ;
0 commit comments