diff options
author | Lucio Franco <luciofranco14@gmail.com> | 2020-08-27 20:05:48 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-27 20:05:48 -0400 |
commit | d600ab9a8f37e9eff3fa8587069a816b65b6da0b (patch) | |
tree | 06d14901604c5c7822b43d9f4973fdccd15509e7 /tokio/src/task/local.rs | |
parent | d9d909cb4c6d326423ee02fbcf6bbfe5553d2c0a (diff) |
rt: Refactor `Runtime::block_on` to take `&self` (#2782)
Co-authored-by: Eliza Weisman <eliza@buoyant.io>
Diffstat (limited to 'tokio/src/task/local.rs')
-rw-r--r-- | tokio/src/task/local.rs | 10 |
1 files changed, 5 insertions, 5 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, { |