From 8d390ad35df9c147aa9a1efd487185ef05c1ee16 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Sat, 4 Jan 2025 22:05:24 +0100 Subject: [PATCH] Replace futures-util with futures-core in non-test code --- http-body-util/Cargo.toml | 3 ++- http-body-util/src/combinators/collect.rs | 3 ++- http-body-util/src/combinators/with_trailers.rs | 2 +- http-body-util/src/stream.rs | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/http-body-util/Cargo.toml b/http-body-util/Cargo.toml index 80a642d..e85ed8a 100644 --- a/http-body-util/Cargo.toml +++ b/http-body-util/Cargo.toml @@ -28,10 +28,11 @@ rust-version = "1.56" [dependencies] bytes = "1" -futures-util = { version = "0.3", default-features = false } +futures-core = { version = "0.3", default-features = false } http = "1" http-body = { version = "1", path = "../http-body" } pin-project-lite = "0.2" [dev-dependencies] +futures-util = { version = "0.3", default-features = false } tokio = { version = "1", features = ["macros", "rt", "sync", "rt-multi-thread"] } diff --git a/http-body-util/src/combinators/collect.rs b/http-body-util/src/combinators/collect.rs index d89e721..1da44d7 100644 --- a/http-body-util/src/combinators/collect.rs +++ b/http-body-util/src/combinators/collect.rs @@ -4,6 +4,7 @@ use std::{ task::{Context, Poll}, }; +use futures_core::ready; use http_body::Body; use pin_project_lite::pin_project; @@ -29,7 +30,7 @@ impl Future for Collect { let mut me = self.project(); loop { - let frame = futures_util::ready!(me.body.as_mut().poll_frame(cx)); + let frame = ready!(me.body.as_mut().poll_frame(cx)); let frame = if let Some(frame) = frame { frame? diff --git a/http-body-util/src/combinators/with_trailers.rs b/http-body-util/src/combinators/with_trailers.rs index 92f466a..38e0061 100644 --- a/http-body-util/src/combinators/with_trailers.rs +++ b/http-body-util/src/combinators/with_trailers.rs @@ -4,7 +4,7 @@ use std::{ task::{Context, Poll}, }; -use futures_util::ready; +use futures_core::ready; use http::HeaderMap; use http_body::{Body, Frame}; use pin_project_lite::pin_project; diff --git a/http-body-util/src/stream.rs b/http-body-util/src/stream.rs index 7eeafad..f239c80 100644 --- a/http-body-util/src/stream.rs +++ b/http-body-util/src/stream.rs @@ -1,5 +1,5 @@ use bytes::Buf; -use futures_util::{ready, stream::Stream}; +use futures_core::{ready, stream::Stream}; use http_body::{Body, Frame}; use pin_project_lite::pin_project; use std::{