serve also requires hyper/http1

This commit is contained in:
David Pedersen 2023-03-24 15:25:29 +01:00
parent f1c0b118ea
commit b1e9930eb6
3 changed files with 3 additions and 4 deletions

View file

@ -148,7 +148,7 @@ impl BenchmarkBuilder {
let addr = listener.local_addr().unwrap();
std::thread::spawn(move || {
rt.block_on(axum::serve(listener, app));
rt.block_on(axum::serve(listener, app)).unwrap();
});
let mut cmd = Command::new("rewrk");

View file

@ -441,7 +441,7 @@ pub mod handler;
pub mod middleware;
pub mod response;
pub mod routing;
#[cfg(feature = "tokio")]
#[cfg(all(feature = "tokio", feature = "http1"))]
pub mod serve;
#[cfg(test)]
@ -477,7 +477,7 @@ pub use axum_core::{BoxError, Error, RequestExt, RequestPartsExt};
#[cfg(feature = "macros")]
pub use axum_macros::debug_handler;
#[cfg(feature = "tokio")]
#[cfg(all(feature = "tokio", feature = "http1"))]
#[doc(inline)]
pub use self::serve::serve;

View file

@ -62,7 +62,6 @@ mod tests {
use http_body_util::BodyExt;
use serde_json::{json, Value};
use std::net::SocketAddr;
use tokio::net::TcpListener;
use tower::Service; // for `call`
use tower::ServiceExt; // for `oneshot` and `ready` // for `collect`