forked from Orchid/orchid
Phased out async-stream in pursuit of compile performance
This commit is contained in:
@@ -4,7 +4,7 @@ use std::future::Future;
|
||||
use std::marker::PhantomData;
|
||||
use std::rc::Rc;
|
||||
|
||||
use async_stream::stream;
|
||||
use async_fn_stream::stream;
|
||||
use futures::future::join_all;
|
||||
use futures::{FutureExt, StreamExt};
|
||||
use itertools::Itertools;
|
||||
@@ -195,11 +195,11 @@ pub async fn ttv_from_api<H: ExprRepr, X: ExtraTok>(
|
||||
src: &Sym,
|
||||
i: &Interner,
|
||||
) -> Vec<TokTree<H, X>> {
|
||||
stream! {
|
||||
stream(async |mut cx| {
|
||||
for tok in tokv {
|
||||
yield TokTree::<H, X>::from_api(tok.borrow(), hctx, xctx, src, i).boxed_local().await
|
||||
cx.emit(TokTree::<H, X>::from_api(tok.borrow(), hctx, xctx, src, i).boxed_local().await).await
|
||||
}
|
||||
}
|
||||
})
|
||||
.collect()
|
||||
.await
|
||||
}
|
||||
@@ -209,11 +209,11 @@ pub async fn ttv_into_api<H: ExprRepr, X: ExtraTok>(
|
||||
hctx: &mut H::ToApiCtx<'_>,
|
||||
xctx: &mut X::ToApiCtx<'_>,
|
||||
) -> Vec<api::TokenTree> {
|
||||
stream! {
|
||||
stream(async |mut cx| {
|
||||
for tok in tokv {
|
||||
yield tok.into_api(hctx, xctx).await
|
||||
cx.emit(tok.into_api(hctx, xctx).await).await
|
||||
}
|
||||
}
|
||||
})
|
||||
.collect()
|
||||
.await
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user