From a70e686bdf1476ecdb58f12b9d2c437b6daf8208 Mon Sep 17 00:00:00 2001 From: Ottatop Date: Tue, 20 Feb 2024 21:50:59 -0600 Subject: [PATCH] Fix docs --- api/rust/src/util.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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 /// }, /// ]; /// ```