diff --git a/Cargo.toml b/Cargo.toml index 4c82032..7c9a897 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,11 +6,11 @@ edition = "2018" build = "src/build.rs" [dependencies] -users = "0.10.0" +users = "0.11.0" regex = "1.0.1" futures = "0.3" async-trait = "0.1" -tokio = { version = "0.2", features = ["process", "io-util", "rt-core", "macros", "sync"] } +tokio = { version = "0.3", features = ["rt", "process", "io-util", "macros", "sync"] } once_cell = "1.4" [dev-dependencies] diff --git a/src/async_utils.rs b/src/async_utils.rs index 2c1196a..c656c53 100644 --- a/src/async_utils.rs +++ b/src/async_utils.rs @@ -6,11 +6,15 @@ use std::{ thread, time::Duration, }; +use tokio::runtime::Builder; pub use async_trait::async_trait; pub fn run(future: F) -> F::Output { - tokio::runtime::Runtime::new().unwrap().block_on(future) + Builder::new_current_thread() + .build() + .unwrap() + .block_on(future) } pub use tokio::try_join;