mirror of https://github.com/rwf2/Rocket.git
Use tokio's current_thread runtime for async_test to increase performance.
This commit is contained in:
parent
c7ecfc69c3
commit
0d6e46944b
|
@ -153,5 +153,5 @@ pub fn custom(config: config::Config) -> Rocket {
|
||||||
/// WARNING: This is unstable! Do not use this method outside of Rocket!
|
/// WARNING: This is unstable! Do not use this method outside of Rocket!
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub fn async_test<R>(fut: impl std::future::Future<Output = R> + Send) -> R {
|
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)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue