Browse Source

Update dependencies

master
Adrian Heine 4 years ago
parent
commit
b7c6a14571
  1. 4
      Cargo.toml
  2. 6
      src/async_utils.rs

4
Cargo.toml

@ -6,11 +6,11 @@ edition = "2018"
build = "src/build.rs" build = "src/build.rs"
[dependencies] [dependencies]
users = "0.10.0"
users = "0.11.0"
regex = "1.0.1" regex = "1.0.1"
futures = "0.3" futures = "0.3"
async-trait = "0.1" 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" once_cell = "1.4"
[dev-dependencies] [dev-dependencies]

6
src/async_utils.rs

@ -6,11 +6,15 @@ use std::{
thread, thread,
time::Duration, time::Duration,
}; };
use tokio::runtime::Builder;
pub use async_trait::async_trait; pub use async_trait::async_trait;
pub fn run<F: Future>(future: F) -> F::Output { pub fn run<F: Future>(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; pub use tokio::try_join;

Loading…
Cancel
Save