diff options
author | Carl Lerche <me@carllerche.com> | 2019-11-06 09:51:15 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-06 09:51:15 -0800 |
commit | 1a7f6fb201c04e8bb02c6e59ddaabadceb8413c2 (patch) | |
tree | 22cf0775346af87d0dd59cab8471e6df23589f9d /tokio/src/runtime/mod.rs | |
parent | 0da23aad772afb22db8edf73ac0f034c5ada3bde (diff) |
simplify enter (#1736)
Diffstat (limited to 'tokio/src/runtime/mod.rs')
-rw-r--r-- | tokio/src/runtime/mod.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tokio/src/runtime/mod.rs b/tokio/src/runtime/mod.rs index ac5bee97..9dbc857a 100644 --- a/tokio/src/runtime/mod.rs +++ b/tokio/src/runtime/mod.rs @@ -146,6 +146,8 @@ mod current_thread; #[cfg(feature = "blocking")] mod enter; +#[cfg(feature = "blocking")] +pub(crate) use self::enter::enter; mod global; pub use self::global::spawn; @@ -340,10 +342,7 @@ impl Runtime { let kind = &mut self.kind; blocking::with_pool(&self.blocking_pool, || match kind { - Kind::Shell => { - let mut enter = enter::enter().unwrap(); - enter.block_on(future) - } + Kind::Shell => enter().block_on(future), #[cfg(feature = "rt-current-thread")] Kind::CurrentThread(exec) => exec.block_on(future), #[cfg(feature = "rt-full")] |