From 0ddb0dd22560debb8066b3d892a91748d797fa20 Mon Sep 17 00:00:00 2001 From: Rob Parrett Date: Wed, 19 Oct 2022 18:54:37 +0000 Subject: [PATCH] fix failing doc test and clear up docs # Objective Alternative to #6150 Dependabot's PR doesn't seem to break anything, but there are some deprecations that we might as well fix up. ## Solution https://github.com/clap-rs/clap/blob/master/CHANGELOG.md#migrating Update clap in `build-wasm-example` and `span-cmp`. Other tools don't use clap. Remove references to `value_parser`. It's the default now. Change `#[clap()]` to `#[arg()]`. Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- crates/bevy_tasks/src/task_pool.rs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/crates/bevy_tasks/src/task_pool.rs b/crates/bevy_tasks/src/task_pool.rs index e0ac0101d56ac..f04a141349f6e 100644 --- a/crates/bevy_tasks/src/task_pool.rs +++ b/crates/bevy_tasks/src/task_pool.rs @@ -164,11 +164,19 @@ impl TaskPool { /// }); /// }); /// - /// // results are returned in the order the tasks are spawned in. - /// // Note: the ordering may become non-deterministic if you spawn from within tasks. - /// // the ordering is only guaranteed when tasks are spawned directly from the main closure. + /// // The ordering of results is non-deterministic if you spawn from within tasks as above. + /// // This commented out assert will fail intermittently because the inner spawn can be inserted into + /// // the queue before the outer one. + /// // assert_eq!(&results[..], &[0, 1]); + /// + /// // The ordering is deterministic if you only spawn directly from the closure function. + /// let results = pool.scope(|s| { + /// s.spawn(async { 0 }); + /// s.spawn(async { 1 }); + /// }); /// assert_eq!(&results[..], &[0, 1]); - /// // can access x after scope runs + /// + /// // You can access x after scope runs, since it was only temporarily borrowed in the scope. /// assert_eq!(x, 2); /// ``` ///