From 9771491c9463ed43400dd18dcf21ee0bbd97290a Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Wed, 13 Aug 2025 17:23:44 +0300 Subject: [PATCH] arrays.parallel: fix `v doc -unsafe-run-examples -f none vlib/arrays/parallel/` too --- vlib/arrays/parallel/parallel.v | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vlib/arrays/parallel/parallel.v b/vlib/arrays/parallel/parallel.v index f600de410..644957b79 100644 --- a/vlib/arrays/parallel/parallel.v +++ b/vlib/arrays/parallel/parallel.v @@ -22,7 +22,7 @@ fn limited_workers(max_workers int, ilen int) int { // run lets the user run an array of input with a user provided function in parallel. // It limits the number of worker threads to min(num_workers, num_cpu). // The function aborts if an error is encountered. -// Example: parallel.run([1, 2, 3, 4, 5], 2, fn (i) { println(i) }) +// Example: parallel.run([1, 2, 3, 4, 5], |i| println(i)) pub fn run[T](input []T, worker fn (T), opt Params) { if input.len == 0 { return @@ -61,7 +61,7 @@ struct Task[T, R] { // It limits the number of worker threads to max number of cpus. // The worker function can return a value. The returning array maintains the input order. // Any error handling should have happened within the worker function. -// Example: squares := parallel.amap([1, 2, 3, 4, 5], 2, fn (i) { return i * i }) +// Example: squares := parallel.amap([1, 2, 3, 4, 5], |i| i * i); assert squares == [1, 4, 9, 16, 25] pub fn amap[T, R](input []T, worker fn (T) R, opt Params) []R { if input.len == 0 { return [] -- 2.39.5