diff --git a/Cargo.toml b/Cargo.toml index e7a0204..ec1f674 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ build = "src/build.rs" [dependencies] users = "0.11.0" regex = "1.0.1" -futures = "0.3" +futures-util = "0.3" async-trait = "0.1" tokio = { version = "1.6.1", features = ["rt", "process", "io-util", "macros", "sync"] } once_cell = "1.4" diff --git a/src/async_utils.rs b/src/async_utils.rs index f049b26..84613b0 100644 --- a/src/async_utils.rs +++ b/src/async_utils.rs @@ -71,7 +71,7 @@ pub fn sleep(duration: Duration) -> impl Future { #[cfg(test)] mod test { use crate::async_utils::{run, sleep}; - use futures::future::FutureExt; + use futures_util::future::FutureExt; use std::time::{Duration, Instant}; #[test] @@ -80,9 +80,9 @@ mod test { let start = Instant::now(); let sleep = sleep(Duration::from_millis(100)).fuse(); let ok = async {}.fuse(); - futures::pin_mut!(sleep, ok); + futures_util::pin_mut!(sleep, ok); loop { - futures::select! { + futures_util::select! { _ = sleep => {}, _ = ok => assert!((Instant::now() - start).as_millis() < 100), complete => break, diff --git a/src/command_runner.rs b/src/command_runner.rs index 0a64621..b672a4c 100644 --- a/src/command_runner.rs +++ b/src/command_runner.rs @@ -192,7 +192,7 @@ mod test { use crate::args; use crate::async_utils::run; use crate::command_runner::{CommandRunner, StdCommandRunner}; - use futures::future::FutureExt; + use futures_util::future::FutureExt; use std::time::Instant; #[test] @@ -203,9 +203,9 @@ mod test { let start = Instant::now(); let res = c.run("sleep", args, "").fuse(); let ps = c.run("ps", args![], "").fuse(); - futures::pin_mut!(res, ps); + futures_util::pin_mut!(res, ps); loop { - futures::select! { + futures_util::select! { _ = res => {}, _ = ps => assert!((Instant::now() - start).as_millis() < 1000), complete => break, diff --git a/src/setup/setup.rs b/src/setup/setup.rs index 472d52e..cad65cd 100644 --- a/src/setup/setup.rs +++ b/src/setup/setup.rs @@ -6,8 +6,7 @@ use crate::async_utils::sleep; use crate::loggers::{Logger, StoringLogger}; use crate::resources::{DefaultArtifacts, DefaultResources, FromArtifact, FromResource}; use crate::{DefaultBuilder, DefaultLocator}; -use futures::future::FutureExt; -use futures::future::Shared; +use futures_util::future::{FutureExt, Shared}; use std::cell::{RefCell, RefMut}; use std::collections::HashMap; use std::error::Error; diff --git a/src/symbols/git/checkout.rs b/src/symbols/git/checkout.rs index bb2f867..4063aa9 100644 --- a/src/symbols/git/checkout.rs +++ b/src/symbols/git/checkout.rs @@ -147,8 +147,7 @@ mod test { ] ); drop(first_two_args); - assert_eq!(args[2], - ["-C", "target", "rev-list", "-1", "FETCH_HEAD"]); + assert_eq!(args[2], ["-C", "target", "rev-list", "-1", "FETCH_HEAD"]); assert!((end - start).as_millis() >= 100); assert!((end - start).as_millis() < 150);