1
0
Fork 0
mirror of https://github.com/tokio-rs/axum.git synced 2025-04-26 13:56:22 +02:00

Dependency cleanup ()

This commit is contained in:
Jonas Platte 2025-01-05 09:34:14 +01:00 committed by GitHub
parent ef0b99b6a0
commit f84105ae8b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 19 additions and 46 deletions
Cargo.lock
axum-core
axum-extra
axum/src
extract
middleware
response
routing
examples
low-level-native-tls
unix-domain-socket

27
Cargo.lock generated
View file

@ -234,28 +234,6 @@ dependencies = [
"sha2 0.9.9",
]
[[package]]
name = "async-stream"
version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476"
dependencies = [
"async-stream-impl",
"futures-core",
"pin-project-lite",
]
[[package]]
name = "async-stream-impl"
version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.93",
]
[[package]]
name = "async-trait"
version = "0.1.83"
@ -377,7 +355,7 @@ dependencies = [
"axum-extra",
"axum-macros",
"bytes",
"futures-util",
"futures-core",
"http 1.2.0",
"http-body 1.0.1",
"http-body-util",
@ -397,7 +375,6 @@ dependencies = [
name = "axum-extra"
version = "0.10.0"
dependencies = [
"async-stream",
"axum",
"axum-core",
"axum-macros",
@ -1580,7 +1557,6 @@ dependencies = [
"hyper-util",
"tokio",
"tokio-native-tls",
"tower 0.5.2",
"tower-service",
"tracing",
"tracing-subscriber",
@ -1962,7 +1938,6 @@ dependencies = [
"hyper 1.5.2",
"hyper-util",
"tokio",
"tower 0.5.2",
"tracing-subscriber",
]

View file

@ -19,7 +19,7 @@ __private_docs = ["dep:tower-http"]
[dependencies]
bytes = "1.2"
futures-util = { version = "0.3", default-features = false, features = ["alloc"] }
futures-core = "0.3"
http = "1.0.0"
http-body = "1.0.0"
http-body-util = "0.1.0"
@ -38,7 +38,6 @@ tracing = { version = "0.1.37", default-features = false, optional = true }
axum = { path = "../axum", features = ["__private"] }
axum-extra = { path = "../axum-extra", features = ["typed-header"] }
axum-macros = { path = "../axum-macros", features = ["__private"] }
futures-util = { version = "0.3", default-features = false, features = ["alloc"] }
hyper = "1.0.0"
tokio = { version = "1.25.0", features = ["macros"] }
tower-http = { version = "0.6.0", features = ["limit"] }

View file

@ -2,13 +2,12 @@
use crate::{BoxError, Error};
use bytes::Bytes;
use futures_util::stream::Stream;
use futures_util::TryStream;
use futures_core::{Stream, TryStream};
use http_body::{Body as _, Frame};
use http_body_util::BodyExt;
use pin_project_lite::pin_project;
use std::pin::Pin;
use std::task::{Context, Poll};
use std::task::{ready, Context, Poll};
use sync_wrapper::SyncWrapper;
type BoxBody = http_body_util::combinators::UnsyncBoxBody<Bytes, Error>;
@ -147,7 +146,7 @@ impl Stream for BodyDataStream {
#[inline]
fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
loop {
match futures_util::ready!(Pin::new(&mut self.inner).poll_frame(cx)?) {
match ready!(Pin::new(&mut self.inner).poll_frame(cx)?) {
Some(frame) => match frame.into_data() {
Ok(data) => return Poll::Ready(Some(Ok(data))),
Err(_frame) => {}
@ -202,7 +201,7 @@ where
cx: &mut Context<'_>,
) -> Poll<Option<Result<Frame<Self::Data>, Self::Error>>> {
let stream = self.project().stream.get_pin_mut();
match futures_util::ready!(stream.try_poll_next(cx)) {
match ready!(stream.try_poll_next(cx)) {
Some(Ok(chunk)) => Poll::Ready(Some(Ok(Frame::data(chunk.into())))),
Some(Err(err)) => Poll::Ready(Some(Err(Error::new(err)))),
None => Poll::Ready(None),

View file

@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning].
# Unreleased
- **breaking:** Remove unused `async-stream` feature, which was accidentally
introduced as an implicit feature through an optional dependency which was no
longer being used ([#3145])
[#3145]: https://github.com/tokio-rs/axum/pull/3145
# 0.10.0
## since rc.1

View file

@ -57,7 +57,6 @@ tower-layer = "0.3"
tower-service = "0.3"
# optional dependencies
async-stream = { version = "0.3", optional = true }
axum-macros = { path = "../axum-macros", version = "0.5.0", optional = true }
cookie = { package = "cookie", version = "0.18.0", features = ["percent-encode"], optional = true }
fastrand = { version = "2.1.0", optional = true }

View file

@ -109,7 +109,7 @@ use std::{
borrow::Cow,
future::Future,
pin::Pin,
task::{Context, Poll},
task::{ready, Context, Poll},
};
use tokio_tungstenite::{
tungstenite::{
@ -518,7 +518,7 @@ impl Stream for WebSocket {
fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
loop {
match futures_util::ready!(self.inner.poll_next_unpin(cx)) {
match ready!(self.inner.poll_next_unpin(cx)) {
Some(Ok(msg)) => {
if let Some(msg) = Message::from_tungstenite(msg) {
return Poll::Ready(Some(Ok(msg)));

View file

@ -2,7 +2,7 @@ use crate::{
extract::FromRequestParts,
response::{IntoResponse, Response},
};
use futures_util::{future::BoxFuture, ready};
use futures_util::future::BoxFuture;
use http::Request;
use pin_project_lite::pin_project;
use std::{
@ -10,7 +10,7 @@ use std::{
future::Future,
marker::PhantomData,
pin::Pin,
task::{Context, Poll},
task::{ready, Context, Poll},
};
use tower_layer::Layer;
use tower_service::Service;

View file

@ -34,17 +34,14 @@ use axum_core::{
response::{IntoResponse, Response},
};
use bytes::{BufMut, BytesMut};
use futures_util::{
ready,
stream::{Stream, TryStream},
};
use futures_util::stream::{Stream, TryStream};
use http_body::Frame;
use pin_project_lite::pin_project;
use std::{
fmt,
future::Future,
pin::Pin,
task::{Context, Poll},
task::{ready, Context, Poll},
time::Duration,
};
use sync_wrapper::SyncWrapper;

View file

@ -230,7 +230,7 @@ impl Future for InfallibleRouteFuture {
type Output = Response;
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
match futures_util::ready!(self.project().future.poll(cx)) {
match ready!(self.project().future.poll(cx)) {
Ok(response) => Poll::Ready(response),
Err(err) => match err {},
}

View file

@ -11,7 +11,6 @@ hyper = { version = "1.0.0", features = ["full"] }
hyper-util = { version = "0.1" }
tokio = { version = "1", features = ["full"] }
tokio-native-tls = "0.3.1"
tower = { version = "0.5.2", features = ["make"] }
tower-service = "0.3.2"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

View file

@ -10,5 +10,4 @@ http-body-util = "0.1"
hyper = { version = "1.0.0", features = ["full"] }
hyper-util = { version = "0.1", features = ["tokio", "server-auto", "http1"] }
tokio = { version = "1.0", features = ["full"] }
tower = { version = "0.5.2", features = ["util"] }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }