Skip to content

Commit d2799d7

Browse files
task: improve the docs of Builder::spawn_local (#7828)
1 parent 4d4870f commit d2799d7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tokio/src/runtime/scheduler/current_thread/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ impl Handle {
499499
F: crate::future::Future + 'static,
500500
F::Output: 'static,
501501
{
502-
// Safety: the caller guarantees that the this is only called on a `LocalRuntime`.
502+
// Safety: the caller guarantees that this is only called on a `LocalRuntime`.
503503
let (handle, notified) = unsafe {
504504
me.shared
505505
.owned

tokio/src/task/builder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use std::{future::Future, io, mem};
2020
/// the task
2121
///
2222
/// There are three types of task that can be spawned from a Builder:
23-
/// - [`spawn_local`] for executing futures on the current thread
23+
/// - [`spawn_local`] for executing not [`Send`] futures
2424
/// - [`spawn`] for executing [`Send`] futures on the runtime
2525
/// - [`spawn_blocking`] for executing blocking code in the
2626
/// blocking thread pool.
@@ -118,7 +118,7 @@ impl<'a> Builder<'a> {
118118
})
119119
}
120120

121-
/// Spawns `!Send` a task on the current [`LocalSet`] or [`LocalRuntime`] with
121+
/// Spawns a `!Send` task on the current [`LocalSet`] or [`LocalRuntime`] with
122122
/// this builder's settings.
123123
///
124124
/// The spawned future will be run on the same thread that called `spawn_local`.

0 commit comments

Comments
 (0)