summaryrefslogtreecommitdiffstats
path: root/tokio/src/task
diff options
context:
space:
mode:
authorLucio Franco <luciofranco14@gmail.com>2020-08-27 20:05:48 -0400
committerGitHub <noreply@github.com>2020-08-27 20:05:48 -0400
commitd600ab9a8f37e9eff3fa8587069a816b65b6da0b (patch)
tree06d14901604c5c7822b43d9f4973fdccd15509e7 /tokio/src/task
parentd9d909cb4c6d326423ee02fbcf6bbfe5553d2c0a (diff)
rt: Refactor `Runtime::block_on` to take `&self` (#2782)
Co-authored-by: Eliza Weisman <eliza@buoyant.io>
Diffstat (limited to 'tokio/src/task')
-rw-r--r--tokio/src/task/local.rs10
-rw-r--r--tokio/src/task/spawn.rs2
2 files changed, 6 insertions, 6 deletions
diff --git a/tokio/src/task/local.rs b/tokio/src/task/local.rs
index 3c409edf..a56453df 100644
--- a/tokio/src/task/local.rs
+++ b/tokio/src/task/local.rs
@@ -312,9 +312,9 @@ impl LocalSet {
/// use tokio::runtime::Runtime;
/// use tokio::task;
///
- /// let mut rt = Runtime::new().unwrap();
+ /// let rt = Runtime::new().unwrap();
/// let local = task::LocalSet::new();
- /// local.block_on(&mut rt, async {
+ /// local.block_on(&rt, async {
/// let join = task::spawn_local(async {
/// let blocking_result = task::block_in_place(|| {
/// // ...
@@ -329,9 +329,9 @@ impl LocalSet {
/// use tokio::runtime::Runtime;
/// use tokio::task;
///
- /// let mut rt = Runtime::new().unwrap();
+ /// let rt = Runtime::new().unwrap();
/// let local = task::LocalSet::new();
- /// local.block_on(&mut rt, async {
+ /// local.block_on(&rt, async {
/// let join = task::spawn_local(async {
/// let blocking_result = task::spawn_blocking(|| {
/// // ...
@@ -346,7 +346,7 @@ impl LocalSet {
/// [`Runtime::block_on`]: method@crate::runtime::Runtime::block_on
/// [in-place blocking]: fn@crate::task::block_in_place
/// [`spawn_blocking`]: fn@crate::task::spawn_blocking
- pub fn block_on<F>(&self, rt: &mut crate::runtime::Runtime, future: F) -> F::Output
+ pub fn block_on<F>(&self, rt: &crate::runtime::Runtime, future: F) -> F::Output
where
F: Future,
{
diff --git a/tokio/src/task/spawn.rs b/tokio/src/task/spawn.rs
index d6e77118..280e90ea 100644
--- a/tokio/src/task/spawn.rs
+++ b/tokio/src/task/spawn.rs
@@ -18,7 +18,7 @@ doc_rt_core! {
///
/// This function must be called from the context of a Tokio runtime. Tasks running on
/// the Tokio runtime are always inside its context, but you can also enter the context
- /// using the [`Handle::enter`](crate::runtime::Handle::enter()) method.
+ /// using the [`Runtime::enter`](crate::runtime::Runtime::enter()) method.
///
/// # Examples
///