Skip to content

Commit 869ba86

Browse files
Reduce dependency on futures-util (#3358)
1 parent d0aff24 commit 869ba86

File tree

32 files changed

+50
-67
lines changed

32 files changed

+50
-67
lines changed

Cargo.lock

Lines changed: 8 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

axum-extra/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ __private_docs = [
8787
axum = { path = "../axum", version = "0.8.4", default-features = false, features = ["original-uri"] }
8888
axum-core = { path = "../axum-core", version = "0.5.2" }
8989
bytes = "1.1.0"
90+
futures-core = "0.3"
9091
futures-util = { version = "0.3", default-features = false, features = ["alloc"] }
9192
http = "1.0.0"
9293
http-body = "1.0.0"

axum-extra/src/extract/multipart.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use axum::{
1010
};
1111
use axum_core::__composite_rejection as composite_rejection;
1212
use axum_core::__define_rejection as define_rejection;
13-
use futures_util::stream::Stream;
13+
use futures_core::stream::Stream;
1414
use http::{
1515
header::{HeaderMap, CONTENT_TYPE},
1616
Request, StatusCode,

axum-extra/src/handler/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ use axum::{
77
handler::Handler,
88
response::{IntoResponse, Response},
99
};
10-
use futures_util::future::{BoxFuture, FutureExt, Map};
10+
use futures_core::future::BoxFuture;
11+
use futures_util::future::{FutureExt, Map};
1112
use std::{future::Future, marker::PhantomData};
1213

1314
mod or;

axum-extra/src/handler/or.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ use axum::{
55
handler::Handler,
66
response::{IntoResponse, Response},
77
};
8-
use futures_util::future::{BoxFuture, Either as EitherFuture, FutureExt, Map};
8+
use futures_core::future::BoxFuture;
9+
use futures_util::future::{Either as EitherFuture, FutureExt, Map};
910
use std::{future::Future, marker::PhantomData};
1011

1112
/// [`Handler`] that runs one [`Handler`] and if that rejects it'll fallback to another

axum-extra/src/json_lines.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ use axum::{
77
BoxError,
88
};
99
use bytes::{BufMut, BytesMut};
10-
use futures_util::stream::{BoxStream, Stream, TryStream, TryStreamExt};
10+
use futures_core::{stream::BoxStream, Stream, TryStream};
11+
use futures_util::stream::TryStreamExt;
1112
use pin_project_lite::pin_project;
1213
use serde::{de::DeserializeOwned, Serialize};
1314
use std::{
@@ -44,7 +45,7 @@ pin_project! {
4445
/// ```rust
4546
/// use axum::{BoxError, response::{IntoResponse, Response}};
4647
/// use axum_extra::json_lines::JsonLines;
47-
/// use futures_util::stream::Stream;
48+
/// use futures_core::stream::Stream;
4849
///
4950
/// fn stream_of_values() -> impl Stream<Item = Result<serde_json::Value, BoxError>> {
5051
/// # futures_util::stream::empty()

axum-extra/src/response/file_stream.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use axum::{
44
BoxError,
55
};
66
use bytes::Bytes;
7-
use futures_util::TryStream;
7+
use futures_core::TryStream;
88
use http::{header, StatusCode};
99
use std::{io, path::Path};
1010
use tokio::{

axum/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ __private = ["tokio", "http1", "dep:reqwest"]
8888
[dependencies]
8989
axum-core = { path = "../axum-core", version = "0.5.2" }
9090
bytes = "1.0"
91+
futures-core = "0.3"
92+
futures-sink = "0.3"
9193
futures-util = { version = "0.3", default-features = false, features = ["alloc"] }
9294
http = "1.0.0"
9395
http-body = "1.0.0"

axum/src/docs/middleware.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ use axum::{
208208
body::Body,
209209
extract::Request,
210210
};
211-
use futures_util::future::BoxFuture;
211+
use futures_core::future::BoxFuture;
212212
use tower::{Service, Layer};
213213
use std::task::{Context, Poll};
214214

axum/src/extract/multipart.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use axum_core::{
99
response::{IntoResponse, Response},
1010
RequestExt,
1111
};
12-
use futures_util::stream::Stream;
12+
use futures_core::Stream;
1313
use http::{
1414
header::{HeaderMap, CONTENT_TYPE},
1515
StatusCode,

0 commit comments

Comments
 (0)