Phased out async-stream in pursuit of compile performance
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use std::marker::PhantomData;
|
||||
|
||||
use async_stream::stream;
|
||||
use async_fn_stream::stream;
|
||||
use futures::future::{LocalBoxFuture, join_all};
|
||||
use futures::{FutureExt, Stream, StreamExt};
|
||||
use itertools::Itertools;
|
||||
@@ -218,14 +218,15 @@ impl ConstCtx {
|
||||
sys: self.ctx.sys_id(),
|
||||
names: names.into_iter().map(|n| n.to_api()).collect_vec(),
|
||||
};
|
||||
stream! {
|
||||
stream(async |mut cx| {
|
||||
for name_opt in self.ctx.reqnot().request(resolve_names).await {
|
||||
yield match name_opt {
|
||||
cx.emit(match name_opt {
|
||||
Err(e) => Err(OrcErrv::from_api(&e, self.ctx.i()).await),
|
||||
Ok(name) => Ok(Sym::from_api(name, self.ctx.i()).await)
|
||||
}
|
||||
Ok(name) => Ok(Sym::from_api(name, self.ctx.i()).await),
|
||||
})
|
||||
.await
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
pub async fn names_n<const N: usize>(&self, names: [&Sym; N]) -> [OrcRes<Sym>; N] {
|
||||
self.names(names).collect::<Vec<_>>().await.try_into().expect("Lengths must match")
|
||||
|
||||
Reference in New Issue
Block a user