diff --git a/Cargo.lock b/Cargo.lock index bb4bf14198..dae145216a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1385,7 +1385,6 @@ checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", - "futures-executor", "futures-io", "futures-sink", "futures-task", @@ -1493,7 +1492,6 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ - "futures-channel", "futures-core", "futures-io", "futures-macro", @@ -3401,7 +3399,7 @@ dependencies = [ "criterion", "dotenvy", "env_logger", - "futures", + "futures-util", "hex", "libsqlite3-sys", "paste", @@ -3437,7 +3435,7 @@ dependencies = [ "dialoguer", "dotenvy", "filetime", - "futures", + "futures-util", "glob", "openssl", "serde_json", @@ -3502,7 +3500,6 @@ version = "0.1.0" dependencies = [ "anyhow", "clap", - "futures", "sqlx", "tokio", ] @@ -3536,7 +3533,6 @@ name = "sqlx-example-postgres-chat" version = "0.1.0" dependencies = [ "crossterm", - "futures", "ratatui", "sqlx", "tokio", @@ -3560,7 +3556,6 @@ dependencies = [ "anyhow", "clap", "dotenvy", - "futures", "serde", "serde_json", "sqlx", @@ -3571,7 +3566,7 @@ dependencies = [ name = "sqlx-example-postgres-listen" version = "0.1.0" dependencies = [ - "futures", + "futures-util", "sqlx", "tokio", ] @@ -3584,7 +3579,6 @@ dependencies = [ "async-trait", "clap", "dotenvy", - "futures", "mockall", "sqlx", "tokio", @@ -3597,7 +3591,6 @@ dependencies = [ "anyhow", "clap", "dotenvy", - "futures", "sqlx", "tokio", ] @@ -3606,7 +3599,6 @@ dependencies = [ name = "sqlx-example-postgres-transaction" version = "0.1.0" dependencies = [ - "futures", "sqlx", "tokio", ] @@ -3617,7 +3609,6 @@ version = "0.1.0" dependencies = [ "anyhow", "clap", - "futures", "sqlx", "tokio", ] diff --git a/Cargo.toml b/Cargo.toml index 111ee86f9c..f206eadd26 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -169,7 +169,7 @@ sqlx-sqlite = { workspace = true, optional = true } [dev-dependencies] anyhow = "1.0.52" time_ = { version = "0.3.2", package = "time" } -futures = "0.3.19" +futures-util = { version = "0.3.19", default-features = false, features = ["alloc"] } env_logger = "0.11" async-std = { workspace = true, features = ["attributes"] } tokio = { version = "1.15.0", features = ["full"] } diff --git a/README.md b/README.md index 747ad079f0..f1e53cdced 100644 --- a/README.md +++ b/README.md @@ -326,7 +326,7 @@ The `fetch` query finalizer returns a stream-like type that iterates through the ```rust // provides `try_next` -use futures::TryStreamExt; +use futures_util::TryStreamExt; // provides `try_get` use sqlx::Row; diff --git a/examples/mysql/todos/Cargo.toml b/examples/mysql/todos/Cargo.toml index cb0b59a63b..db8c677980 100644 --- a/examples/mysql/todos/Cargo.toml +++ b/examples/mysql/todos/Cargo.toml @@ -6,7 +6,6 @@ workspace = "../../../" [dependencies] anyhow = "1.0" -futures = "0.3" sqlx = { path = "../../../", features = [ "mysql", "runtime-tokio", "tls-native-tls" ] } clap = { version = "4", features = ["derive"] } tokio = { version = "1.20.0", features = ["rt", "macros"]} diff --git a/examples/postgres/chat/Cargo.toml b/examples/postgres/chat/Cargo.toml index cdeebcb611..ecacff7269 100644 --- a/examples/postgres/chat/Cargo.toml +++ b/examples/postgres/chat/Cargo.toml @@ -6,7 +6,6 @@ workspace = "../../../" [dependencies] sqlx = { path = "../../../", features = [ "postgres", "runtime-tokio", "tls-native-tls" ] } -futures = "0.3.1" tokio = { version = "1.20.0", features = [ "rt-multi-thread", "macros" ] } ratatui = "0.27.0" crossterm = "0.27.0" diff --git a/examples/postgres/json/Cargo.toml b/examples/postgres/json/Cargo.toml index 5ddccede12..edca041d68 100644 --- a/examples/postgres/json/Cargo.toml +++ b/examples/postgres/json/Cargo.toml @@ -7,7 +7,6 @@ workspace = "../../../" [dependencies] anyhow = "1.0" dotenvy = "0.15.0" -futures = "0.3" serde = { version = "1", features = ["derive"] } serde_json = "1" sqlx = { path = "../../../", features = [ "runtime-tokio", "postgres", "json" ] } diff --git a/examples/postgres/listen/Cargo.toml b/examples/postgres/listen/Cargo.toml index ce1d9153aa..636e8c380b 100644 --- a/examples/postgres/listen/Cargo.toml +++ b/examples/postgres/listen/Cargo.toml @@ -6,5 +6,5 @@ workspace = "../../../" [dependencies] sqlx = { path = "../../../", features = [ "runtime-tokio", "postgres" ] } -futures = "0.3.1" +futures-util = { version = "0.3.1", default-features = false } tokio = { version = "1.20.0", features = ["rt-multi-thread", "macros", "time"]} diff --git a/examples/postgres/listen/src/main.rs b/examples/postgres/listen/src/main.rs index 49d97a466d..587dab2a8f 100644 --- a/examples/postgres/listen/src/main.rs +++ b/examples/postgres/listen/src/main.rs @@ -1,4 +1,4 @@ -use futures::TryStreamExt; +use futures_util::TryStreamExt; use sqlx::postgres::PgListener; use sqlx::{Executor, PgPool}; use std::pin::pin; diff --git a/examples/postgres/mockable-todos/Cargo.toml b/examples/postgres/mockable-todos/Cargo.toml index 5d99ab90dc..59bb800224 100644 --- a/examples/postgres/mockable-todos/Cargo.toml +++ b/examples/postgres/mockable-todos/Cargo.toml @@ -6,7 +6,6 @@ workspace = "../../../" [dependencies] anyhow = "1.0" -futures = "0.3" sqlx = { path = "../../../", features = [ "postgres", "runtime-tokio", "tls-native-tls" ] } clap = { version = "4", features = ["derive"] } tokio = { version = "1.20.0", features = ["rt", "macros"]} diff --git a/examples/postgres/todos/Cargo.toml b/examples/postgres/todos/Cargo.toml index 76a57b328c..0696ea57d6 100644 --- a/examples/postgres/todos/Cargo.toml +++ b/examples/postgres/todos/Cargo.toml @@ -6,7 +6,6 @@ workspace = "../../../" [dependencies] anyhow = "1.0" -futures = "0.3" sqlx = { path = "../../../", features = [ "postgres", "runtime-tokio", "tls-native-tls" ] } clap = { version = "4", features = ["derive"] } tokio = { version = "1.20.0", features = ["rt", "macros"]} diff --git a/examples/postgres/transaction/Cargo.toml b/examples/postgres/transaction/Cargo.toml index be91cb7ebf..b6bd4e7cad 100644 --- a/examples/postgres/transaction/Cargo.toml +++ b/examples/postgres/transaction/Cargo.toml @@ -6,5 +6,4 @@ workspace = "../../../" [dependencies] sqlx = { path = "../../../", features = [ "postgres", "runtime-tokio", "tls-native-tls" ] } -futures = "0.3.1" tokio = { version = "1.20.0", features = ["rt-multi-thread", "macros"]} diff --git a/examples/sqlite/todos/Cargo.toml b/examples/sqlite/todos/Cargo.toml index edc6831ae0..544ca2d8df 100644 --- a/examples/sqlite/todos/Cargo.toml +++ b/examples/sqlite/todos/Cargo.toml @@ -6,7 +6,6 @@ workspace = "../../../" [dependencies] anyhow = "1.0" -futures = "0.3" sqlx = { path = "../../../", features = [ "sqlite", "runtime-tokio", "tls-native-tls" ] } clap = { version = "4", features = ["derive"] } tokio = { version = "1.20.0", features = ["rt", "macros"]} diff --git a/sqlx-cli/Cargo.toml b/sqlx-cli/Cargo.toml index f8c821a8f8..fd3d2c3e6d 100644 --- a/sqlx-cli/Cargo.toml +++ b/sqlx-cli/Cargo.toml @@ -33,7 +33,7 @@ sqlx = { workspace = true, default-features = false, features = [ "migrate", "any", ] } -futures = "0.3.19" +futures-util = { version = "0.3.19", features = ["alloc"] } clap = { version = "4.3.10", features = ["derive", "env", "wrap_help"] } clap_complete = { version = "4.3.1", optional = true } chrono = { version = "0.4.19", default-features = false, features = ["clock"] } diff --git a/sqlx-cli/src/lib.rs b/sqlx-cli/src/lib.rs index cb31205b4f..2856f4095b 100644 --- a/sqlx-cli/src/lib.rs +++ b/sqlx-cli/src/lib.rs @@ -1,8 +1,9 @@ +use std::future::Future; use std::io; use std::time::Duration; use anyhow::Result; -use futures::{Future, TryFutureExt}; +use futures_util::TryFutureExt; use sqlx::{AnyConnection, Connection}; use tokio::{select, signal}; diff --git a/sqlx-core/src/acquire.rs b/sqlx-core/src/acquire.rs index 59bac9fa59..e84c3802b8 100644 --- a/sqlx-core/src/acquire.rs +++ b/sqlx-core/src/acquire.rs @@ -111,7 +111,7 @@ macro_rules! impl_acquire { self, ) -> futures_core::future::BoxFuture<'c, Result> { - Box::pin(futures_util::future::ok(self)) + Box::pin(std::future::ready(Ok(self))) } #[inline] diff --git a/sqlx-core/src/any/transaction.rs b/sqlx-core/src/any/transaction.rs index a553cda927..983531c4ef 100644 --- a/sqlx-core/src/any/transaction.rs +++ b/sqlx-core/src/any/transaction.rs @@ -1,4 +1,4 @@ -use futures_util::future::BoxFuture; +use futures_core::future::BoxFuture; use std::borrow::Cow; use crate::any::{Any, AnyConnection}; diff --git a/sqlx-core/src/executor.rs b/sqlx-core/src/executor.rs index 84b1a660d8..f1a6ff4ba8 100644 --- a/sqlx-core/src/executor.rs +++ b/sqlx-core/src/executor.rs @@ -5,8 +5,8 @@ use crate::error::{BoxDynError, Error}; use either::Either; use futures_core::future::BoxFuture; use futures_core::stream::BoxStream; -use futures_util::{future, FutureExt, StreamExt, TryFutureExt, TryStreamExt}; -use std::fmt::Debug; +use futures_util::{FutureExt, StreamExt, TryFutureExt, TryStreamExt}; +use std::{fmt::Debug, future}; /// A type that contains or can provide a database /// connection to use for executing queries against the database. @@ -121,9 +121,11 @@ pub trait Executor<'c>: Send + Debug + Sized { E: 'q + Execute<'q, Self::Database>, { self.fetch_optional(query) - .and_then(|row| match row { - Some(row) => future::ok(row), - None => future::err(Error::RowNotFound), + .and_then(|row| { + future::ready(match row { + Some(row) => Ok(row), + None => Err(Error::RowNotFound), + }) }) .boxed() } diff --git a/sqlx-core/src/ext/async_stream.rs b/sqlx-core/src/ext/async_stream.rs index c41d940981..31c4db2d97 100644 --- a/sqlx-core/src/ext/async_stream.rs +++ b/sqlx-core/src/ext/async_stream.rs @@ -3,7 +3,7 @@ //! This was created initially to get around some weird compiler errors we were getting with //! `async-stream`, and now it'd just be more work to replace. -use std::future::Future; +use std::future::{self, Future}; use std::pin::Pin; use std::sync::{Arc, Mutex}; use std::task::{Context, Poll}; @@ -76,7 +76,7 @@ impl Yielder { // // Note that because this has no way to schedule a wakeup, this could deadlock the task // if called in the wrong place. - futures_util::future::poll_fn(|_cx| { + future::poll_fn(|_cx| { if !yielded { yielded = true; Poll::Pending diff --git a/sqlx-core/src/net/tls/tls_rustls.rs b/sqlx-core/src/net/tls/tls_rustls.rs index 726df324aa..d0129a3b6e 100644 --- a/sqlx-core/src/net/tls/tls_rustls.rs +++ b/sqlx-core/src/net/tls/tls_rustls.rs @@ -1,7 +1,7 @@ -use futures_util::future; +use std::future; use std::io::{self, Read, Write}; use std::sync::Arc; -use std::task::{Context, Poll}; +use std::task::{ready, Context, Poll}; use rustls::{ client::{ @@ -33,7 +33,7 @@ impl RustlsSocket { loop { match self.state.complete_io(&mut self.inner) { Err(e) if e.kind() == io::ErrorKind::WouldBlock => { - futures_util::ready!(self.inner.poll_ready(cx))?; + ready!(self.inner.poll_ready(cx))?; } ready => return Poll::Ready(ready.map(|_| ())), } @@ -76,12 +76,12 @@ impl Socket for RustlsSocket { self.close_notify_sent = true; } - futures_util::ready!(self.poll_complete_io(cx))?; + ready!(self.poll_complete_io(cx))?; // Server can close socket as soon as it receives the connection shutdown request. // We shouldn't expect it to stick around for the TLS session to close cleanly. // https://security.stackexchange.com/a/82034 - let _ = futures_util::ready!(self.inner.socket.poll_shutdown(cx)); + let _ = ready!(self.inner.socket.poll_shutdown(cx)); Poll::Ready(Ok(())) } diff --git a/sqlx-core/src/net/tls/util.rs b/sqlx-core/src/net/tls/util.rs index ddbc7a58f2..42e11f31be 100644 --- a/sqlx-core/src/net/tls/util.rs +++ b/sqlx-core/src/net/tls/util.rs @@ -1,10 +1,9 @@ use crate::net::Socket; +use std::future; use std::io::{self, Read, Write}; use std::task::{ready, Context, Poll}; -use futures_util::future; - pub struct StdSocket { pub socket: S, wants_read: bool, diff --git a/sqlx-core/src/pool/connection.rs b/sqlx-core/src/pool/connection.rs index c029fec6eb..7912b12aa1 100644 --- a/sqlx-core/src/pool/connection.rs +++ b/sqlx-core/src/pool/connection.rs @@ -1,4 +1,5 @@ use std::fmt::{self, Debug, Formatter}; +use std::future::{self, Future}; use std::ops::{Deref, DerefMut}; use std::sync::Arc; use std::time::{Duration, Instant}; @@ -11,7 +12,6 @@ use crate::error::Error; use super::inner::{is_beyond_max_lifetime, DecrementSizeGuard, PoolInner}; use crate::pool::options::PoolConnectionMetadata; -use std::future::Future; const CLOSE_ON_DROP_TIMEOUT: Duration = Duration::from_secs(5); @@ -183,7 +183,7 @@ impl<'c, DB: Database> crate::acquire::Acquire<'c> for &'c mut PoolConnection futures_core::future::BoxFuture<'c, Result> { - Box::pin(futures_util::future::ok(&mut **self)) + Box::pin(future::ready(Ok(&mut **self))) } #[inline] diff --git a/sqlx-core/src/pool/inner.rs b/sqlx-core/src/pool/inner.rs index 55accfd95d..9cb29f3845 100644 --- a/sqlx-core/src/pool/inner.rs +++ b/sqlx-core/src/pool/inner.rs @@ -9,7 +9,7 @@ use crossbeam_queue::ArrayQueue; use crate::sync::{AsyncSemaphore, AsyncSemaphoreReleaser}; use std::cmp; -use std::future::Future; +use std::future::{self, Future}; use std::pin::pin; use std::sync::atomic::{AtomicBool, AtomicU32, AtomicUsize, Ordering}; use std::sync::{Arc, RwLock}; @@ -18,7 +18,6 @@ use std::task::Poll; use crate::logger::private_level_filter_to_trace_level; use crate::pool::options::PoolConnectionMetadata; use crate::private_tracing_dynamic_event; -use futures_util::future::{self}; use futures_util::FutureExt; use std::time::{Duration, Instant}; use tracing::Level; diff --git a/sqlx-core/src/pool/mod.rs b/sqlx-core/src/pool/mod.rs index d85bce246d..07d592c824 100644 --- a/sqlx-core/src/pool/mod.rs +++ b/sqlx-core/src/pool/mod.rs @@ -59,7 +59,7 @@ use std::fmt; use std::future::Future; use std::pin::{pin, Pin}; use std::sync::Arc; -use std::task::{Context, Poll}; +use std::task::{ready, Context, Poll}; use std::time::{Duration, Instant}; use event_listener::EventListener; @@ -627,7 +627,7 @@ impl Future for CloseEvent { fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { if let Some(listener) = &mut self.listener { - futures_core::ready!(listener.poll_unpin(cx)); + ready!(listener.poll_unpin(cx)); } // `EventListener` doesn't like being polled after it yields, and even if it did it diff --git a/sqlx-core/src/query.rs b/sqlx-core/src/query.rs index 3a982e7e79..0e45643f2e 100644 --- a/sqlx-core/src/query.rs +++ b/sqlx-core/src/query.rs @@ -1,8 +1,8 @@ -use std::marker::PhantomData; +use std::{future, marker::PhantomData}; use either::Either; use futures_core::stream::BoxStream; -use futures_util::{future, StreamExt, TryFutureExt, TryStreamExt}; +use futures_util::{StreamExt, TryFutureExt, TryStreamExt}; use crate::arguments::{Arguments, IntoArguments}; use crate::database::{Database, HasStatementCache}; @@ -459,9 +459,11 @@ where O: 'e, { self.fetch_optional(executor) - .and_then(|row| match row { - Some(row) => future::ok(row), - None => future::err(Error::RowNotFound), + .and_then(|row| { + future::ready(match row { + Some(row) => Ok(row), + None => Err(Error::RowNotFound), + }) }) .await } diff --git a/sqlx-core/src/transaction.rs b/sqlx-core/src/transaction.rs index 0606fbee31..403fe37bd7 100644 --- a/sqlx-core/src/transaction.rs +++ b/sqlx-core/src/transaction.rs @@ -1,5 +1,6 @@ use std::borrow::Cow; use std::fmt::{self, Debug, Formatter}; +use std::future; use std::ops::{Deref, DerefMut}; use futures_core::future::BoxFuture; @@ -247,7 +248,7 @@ impl<'t, DB: Database> crate::acquire::Acquire<'t> for &'t mut Transaction<'_, D #[inline] fn acquire(self) -> BoxFuture<'t, Result> { - Box::pin(futures_util::future::ok(&mut **self)) + Box::pin(future::ready(Ok(&mut **self))) } #[inline] diff --git a/sqlx-sqlite/src/connection/mod.rs b/sqlx-sqlite/src/connection/mod.rs index b94ad91c4d..a39e3047e5 100644 --- a/sqlx-sqlite/src/connection/mod.rs +++ b/sqlx-sqlite/src/connection/mod.rs @@ -3,6 +3,7 @@ use std::cmp::Ordering; use std::ffi::CStr; use std::fmt::Write; use std::fmt::{self, Debug, Formatter}; +use std::future; use std::os::raw::{c_char, c_int, c_void}; use std::panic::catch_unwind; use std::ptr; @@ -10,7 +11,6 @@ use std::ptr::NonNull; use futures_core::future::BoxFuture; use futures_intrusive::sync::MutexGuard; -use futures_util::future; use libsqlite3_sys::{ sqlite3, sqlite3_commit_hook, sqlite3_get_autocommit, sqlite3_progress_handler, sqlite3_rollback_hook, sqlite3_update_hook, SQLITE_DELETE, SQLITE_INSERT, SQLITE_UPDATE, @@ -286,7 +286,7 @@ impl Connection for SqliteConnection { // Well, we could use this to ensure that the command channel has been cleared, // but it would only develop a backlog if a lot of queries are executed and then cancelled // partway through, and then this would only make that situation worse. - Box::pin(future::ok(())) + Box::pin(future::ready(Ok(()))) } #[doc(hidden)] diff --git a/sqlx-test/src/lib.rs b/sqlx-test/src/lib.rs index cc77f38dba..015ff04d93 100644 --- a/sqlx-test/src/lib.rs +++ b/sqlx-test/src/lib.rs @@ -108,7 +108,7 @@ macro_rules! test_unprepared_type { #[sqlx_macros::test] async fn [< test_unprepared_type_ $name >] () -> anyhow::Result<()> { use sqlx::prelude::*; - use futures::TryStreamExt; + use futures_util::TryStreamExt; let mut conn = sqlx_test::new::<$db>().await?; diff --git a/tests/any/any.rs b/tests/any/any.rs index 2c59ca5339..099ff7ddff 100644 --- a/tests/any/any.rs +++ b/tests/any/any.rs @@ -46,7 +46,7 @@ async fn it_executes_with_pool() -> anyhow::Result<()> { #[sqlx_macros::test] async fn it_does_not_stop_stream_after_decoding_error() -> anyhow::Result<()> { - use futures::stream::StreamExt; + use futures_util::stream::StreamExt; sqlx::any::install_default_drivers(); diff --git a/tests/mssql/mssql.rs b/tests/mssql/mssql.rs index 321420d0d2..0986ef1bbd 100644 --- a/tests/mssql/mssql.rs +++ b/tests/mssql/mssql.rs @@ -1,4 +1,4 @@ -use futures::TryStreamExt; +use futures_util::TryStreamExt; use sqlx::mssql::{Mssql, MssqlPoolOptions}; use sqlx::{Column, Connection, Executor, MssqlConnection, Row, Statement, TypeInfo}; use sqlx_core::mssql::MssqlRow; diff --git a/tests/mysql/mysql.rs b/tests/mysql/mysql.rs index 8af6c91de2..c7f7a47960 100644 --- a/tests/mysql/mysql.rs +++ b/tests/mysql/mysql.rs @@ -1,5 +1,5 @@ use anyhow::Context; -use futures::TryStreamExt; +use futures_util::TryStreamExt; use sqlx::mysql::{MySql, MySqlConnection, MySqlPool, MySqlPoolOptions, MySqlRow}; use sqlx::{Column, Connection, Executor, Row, Statement, TypeInfo}; use sqlx_core::connection::ConnectOptions; @@ -460,7 +460,7 @@ async fn test_issue_622() -> anyhow::Result<()> { })); } - futures::future::try_join_all(handles).await?; + futures_util::future::try_join_all(handles).await?; Ok(()) } diff --git a/tests/postgres/derives.rs b/tests/postgres/derives.rs index 13f9bf1d5d..f87bc7d134 100644 --- a/tests/postgres/derives.rs +++ b/tests/postgres/derives.rs @@ -1,4 +1,4 @@ -use futures::TryStreamExt; +use futures_util::TryStreamExt; use sqlx::postgres::types::PgRange; use sqlx::{Connection, Executor, FromRow, Postgres}; use sqlx_postgres::PgHasArrayType; diff --git a/tests/postgres/macros.rs b/tests/postgres/macros.rs index 07ae962018..166f1b67fe 100644 --- a/tests/postgres/macros.rs +++ b/tests/postgres/macros.rs @@ -2,7 +2,7 @@ use sqlx::{Connection, PgConnection, Postgres, Transaction}; use sqlx_postgres::types::PgHstore; use sqlx_test::new; -use futures::TryStreamExt; +use futures_util::TryStreamExt; #[sqlx_macros::test] async fn test_query() -> anyhow::Result<()> { diff --git a/tests/postgres/postgres.rs b/tests/postgres/postgres.rs index f0d453a9a3..d0f3a6e711 100644 --- a/tests/postgres/postgres.rs +++ b/tests/postgres/postgres.rs @@ -1,4 +1,4 @@ -use futures::{Stream, StreamExt, TryStreamExt}; +use futures_util::{Stream, StreamExt, TryStreamExt}; use sqlx::postgres::types::Oid; use sqlx::postgres::{ @@ -604,7 +604,7 @@ async fn it_can_drop_multiple_transactions() -> anyhow::Result<()> { #[ignore] #[sqlx_macros::test] async fn pool_smoke_test() -> anyhow::Result<()> { - use futures::{future, task::Poll, Future}; + use futures_util::{task::Poll, Future}; eprintln!("starting pool"); @@ -645,7 +645,7 @@ async fn pool_smoke_test() -> anyhow::Result<()> { let mut acquire = pin!(pool.acquire()); // poll the acquire future once to put the waiter in the queue - future::poll_fn(move |cx| { + std::future::poll_fn(move |cx| { let _ = acquire.as_mut().poll(cx); Poll::Ready(()) }) @@ -943,7 +943,7 @@ async fn test_issue_622() -> anyhow::Result<()> { })); } - futures::future::try_join_all(handles).await?; + futures_util::future::try_join_all(handles).await?; Ok(()) } diff --git a/tests/sqlite/sqlite.rs b/tests/sqlite/sqlite.rs index 4d24b07412..24d84a9bb8 100644 --- a/tests/sqlite/sqlite.rs +++ b/tests/sqlite/sqlite.rs @@ -1,4 +1,4 @@ -use futures::TryStreamExt; +use futures_util::TryStreamExt; use rand::{Rng, SeedableRng}; use rand_xoshiro::Xoshiro256PlusPlus; use sqlx::sqlite::{SqliteConnectOptions, SqliteOperation, SqlitePoolOptions};