Skip to content

Commit

Permalink
doc: remove incorrect panic section for Builder::worker_threads
Browse files Browse the repository at this point in the history
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: tokio-rs#4773
  • Loading branch information
hds committed Jul 20, 2022
1 parent 56be528 commit 8e2aa68
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions tokio/src/runtime/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
///
Expand Down

0 comments on commit 8e2aa68

Please sign in to comment.