From d9fd563fc9672275bfa13c8dd4648f4e48b9bd79 Mon Sep 17 00:00:00 2001 From: xiao-e-yun Date: Sat, 4 Apr 2026 09:44:29 +0800 Subject: [PATCH] docs: related code display error in docs --- pages/docs/concepts/chains.mdx | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/pages/docs/concepts/chains.mdx b/pages/docs/concepts/chains.mdx index 90eb75f..81ea77b 100644 --- a/pages/docs/concepts/chains.mdx +++ b/pages/docs/concepts/chains.mdx @@ -91,20 +91,20 @@ assert_eq!(result, "16"); Execute multiple operations concurrently using the `parallel!` macro: -```rust filename="rig-core/src/pipeline/parallel.rs [196:208]" - ] - values_and_positions: [ - $($acc)* - $current ( $($underscores)* + ) - ] - munching: [] - } - ); - - // Recursion step: map each value with its "position" (underscore count). - ( - // Accumulate a token for each future that has been expanded: "_ _ _". - current_position: [ +```rust filename="rig-core/src/pipeline/parallel.rs [369:379]" +let op2 = map(|x: i32| x * 2); + + +let pipeline = parallel!( + passthrough(), + op2, + map(|x: i32| format!("{x} is the number!")), + map(|x: i32| x == 1) +); + + +let result = pipeline.call(1).await; +assert_eq!(result, (1, 2, "1 is the number!".to_string(), true)); ``` ## AI-Specific Operations