Phased out async-stream in pursuit of compile performance
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use std::num::NonZero;
|
||||
use std::rc::Rc;
|
||||
|
||||
use async_stream::stream;
|
||||
use async_fn_stream::stream;
|
||||
use dyn_clone::{DynClone, clone_box};
|
||||
use futures::future::{LocalBoxFuture, join_all};
|
||||
use futures::{FutureExt, StreamExt};
|
||||
@@ -209,8 +209,14 @@ impl MemKind {
|
||||
Self::Lazy(lazy) => api::MemberKind::Lazy(ctx.with_lazy(lazy)),
|
||||
Self::Const(c) => api::MemberKind::Const(c.api_return(ctx.sys(), ctx.req()).await),
|
||||
Self::Mod { members } => api::MemberKind::Module(api::Module {
|
||||
members: Box::pin(stream! { for m in members { yield m.into_api(ctx).await } }.collect())
|
||||
.await,
|
||||
members: stream(async |mut cx| {
|
||||
for m in members {
|
||||
cx.emit(m.into_api(ctx).await).await
|
||||
}
|
||||
})
|
||||
.collect()
|
||||
.boxed_local()
|
||||
.await,
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user