Skip to content

Commit c251845

Browse files
committed
Simplify do_serve a bit
1 parent ba4327e commit c251845

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

axum/src/serve/mod.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use std::{
44
convert::Infallible,
55
fmt::Debug,
6-
future::{poll_fn, Future, IntoFuture},
6+
future::{Future, IntoFuture},
77
io,
88
marker::PhantomData,
99
pin::pin,
@@ -308,7 +308,8 @@ where
308308

309309
trace!("connection {remote_addr:?} accepted");
310310

311-
poll_fn(|cx| make_service.poll_ready(cx))
311+
make_service
312+
.ready()
312313
.await
313314
.unwrap_or_else(|err| match err {});
314315

@@ -322,9 +323,7 @@ where
322323
.map_request(|req: Request<Incoming>| req.map(Body::new));
323324

324325
let hyper_service = TowerToHyperService::new(tower_service);
325-
326326
let signal_tx = signal_tx.clone();
327-
328327
let close_rx = close_rx.clone();
329328

330329
tokio::spawn(async move {

0 commit comments

Comments
 (0)