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

chore: remove unused nodelay field in Serve #3076

Merged
merged 1 commit into from
Dec 13, 2024
Merged
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
10 changes: 1 addition & 9 deletions axum/src/serve.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! Serve services.

use std::{
any::TypeId,
convert::Infallible,
fmt::Debug,
future::{poll_fn, Future, IntoFuture},
Expand All @@ -16,7 +15,7 @@ use hyper::body::Incoming;
use hyper_util::rt::{TokioExecutor, TokioIo};
#[cfg(any(feature = "http1", feature = "http2"))]
use hyper_util::{server::conn::auto::Builder, service::TowerToHyperService};
use tokio::{net::TcpListener, sync::watch};
use tokio::sync::watch;
use tower::ServiceExt as _;
use tower_service::Service;

Expand Down Expand Up @@ -99,7 +98,6 @@ where
Serve {
listener,
make_service,
tcp_nodelay: None,
_marker: PhantomData,
}
}
Expand All @@ -110,7 +108,6 @@ where
pub struct Serve<L, M, S> {
listener: L,
make_service: M,
tcp_nodelay: Option<bool>,
_marker: PhantomData<S>,
}

Expand Down Expand Up @@ -168,18 +165,13 @@ where
let Self {
listener,
make_service,
tcp_nodelay,
_marker: _,
} = self;

let mut s = f.debug_struct("Serve");
s.field("listener", listener)
.field("make_service", make_service);

if TypeId::of::<L>() == TypeId::of::<TcpListener>() {
s.field("tcp_nodelay", tcp_nodelay);
}

s.finish()
}
}
Expand Down