From 98d6853fb3edfededfc2ddbe242d61c2674f90d8 Mon Sep 17 00:00:00 2001 From: Roman Volosatovs Date: Thu, 3 Oct 2024 19:34:21 +0200 Subject: [PATCH] fix(rt-wasmtime): rework future awaiting https://github.com/rust-lang/rust/issues/123748 Signed-off-by: Roman Volosatovs --- crates/runtime-wasmtime/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/runtime-wasmtime/src/lib.rs b/crates/runtime-wasmtime/src/lib.rs index 11e74628..7bffbd5c 100644 --- a/crates/runtime-wasmtime/src/lib.rs +++ b/crates/runtime-wasmtime/src/lib.rs @@ -132,14 +132,14 @@ where >, >, { - let futs: FuturesUnordered<_> = zip(0.., deferred) + let mut futs: FuturesUnordered<_> = zip(0.., deferred) .filter_map(|(i, f)| f.map(|f| (w.index(&[i]), f))) .map(|(w, f)| async move { let w = w?; f(w).await }) .collect(); - futs.try_collect().await?; + while let Some(()) = futs.try_next().await? {} Ok(()) }