From 8e2aa68e80de1b532a4267365ebc576cd351ae23 Mon Sep 17 00:00:00 2001 From: Hayden Stainsby Date: Wed, 20 Jul 2022 20:39:51 +0200 Subject: [PATCH] doc: remove incorrect panic section for Builder::worker_threads The documentation for the runtime `Builder::worker_threads` function incorrectly stated that it would panic if used when constructing a `current_thread` runtime. In truth, the call to the function has no effect. Since adding the described panic to the code could cause new panics in existing code using tokio, the documentation has been modified to describe the existing behavior. Refs: #4773 --- tokio/src/runtime/builder.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tokio/src/runtime/builder.rs b/tokio/src/runtime/builder.rs index 8f477a94004..c99b90d097d 100644 --- a/tokio/src/runtime/builder.rs +++ b/tokio/src/runtime/builder.rs @@ -289,11 +289,7 @@ impl Builder { /// /// The default value is the number of cores available to the system. /// - /// # Panics - /// - /// When using the `current_thread` runtime this method will panic, since - /// those variants do not allow setting worker thread counts. - /// + /// When using the `current_thread` runtime this method has no effect. /// /// # Examples ///