Use tokio's current_thread runtime for async_test to increase performance.

This commit is contained in:
Jeb Rosen 2019-09-07 12:31:04 -07:00 committed by Sergio Benitez
parent c7ecfc69c3
commit 0d6e46944b
1 changed files with 1 additions and 1 deletions

View File

@ -153,5 +153,5 @@ pub fn custom(config: config::Config) -> Rocket {
/// WARNING: This is unstable! Do not use this method outside of Rocket!
#[doc(hidden)]
pub fn async_test<R>(fut: impl std::future::Future<Output = R> + Send) -> R {
tokio::runtime::Runtime::new().expect("create tokio runtime").block_on(fut)
tokio::runtime::current_thread::Runtime::new().expect("create tokio runtime").block_on(fut)
}