Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency cleanup #3145

Merged
merged 3 commits into from
Jan 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 1 addition & 26 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions axum-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"] }
Expand Down
9 changes: 4 additions & 5 deletions axum-core/src/body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
Expand Down Expand Up @@ -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) => {}
Expand Down Expand Up @@ -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),
Expand Down
6 changes: 6 additions & 0 deletions axum-extra/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion axum-extra/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
4 changes: 2 additions & 2 deletions axum/src/extract/ws.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ use std::{
borrow::Cow,
future::Future,
pin::Pin,
task::{Context, Poll},
task::{ready, Context, Poll},
};
use tokio_tungstenite::{
tungstenite::{
Expand Down Expand Up @@ -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)));
Expand Down
4 changes: 2 additions & 2 deletions axum/src/middleware/from_extractor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ 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::{
fmt,
future::Future,
marker::PhantomData,
pin::Pin,
task::{Context, Poll},
task::{ready, Context, Poll},
};
use tower_layer::Layer;
use tower_service::Service;
Expand Down
7 changes: 2 additions & 5 deletions axum/src/response/sse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion axum/src/routing/route.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {},
}
Expand Down
1 change: 0 additions & 1 deletion examples/low-level-native-tls/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
1 change: 0 additions & 1 deletion examples/unix-domain-socket/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Loading