diff --git a/api/rust/src/util.rs b/api/rust/src/util.rs index ed787dd..db02c23 100644 --- a/api/rust/src/util.rs +++ b/api/rust/src/util.rs @@ -70,8 +70,7 @@ pub struct Geometry { /// ``` /// pub fn batch(requests: impl IntoIterator>) -> Vec { - let results = FuturesOrdered::from_iter(requests).collect::>(); - block_on_tokio(results) + block_on_tokio(batch_async(requests)) } /// The async version of [`batch`]. @@ -94,17 +93,19 @@ pub async fn batch_async(requests: impl IntoIterator = batch_boxed![ /// async { -/// let mut class = first.class_async().await; +/// let class = first.class_async().await; /// class.unwrap_or("no class".to_string()) /// }, /// async { -/// last.class_async().await +/// let mut class = last.class_async().await.unwrap_or("alalala"); +/// class += "hello"; +/// class /// }, /// ]; /// ```