mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-25 00:00:23 +02:00
Change Router::with_state and impl Service for Router<()> (#1552)
* Implement `Service` for `Router<(), B>` * wip * wip * fix some tests * fix examples * fix doc tests * clean up docs * changelog * fix * also call `with_state` when converting `MethodRouter` into a `MakeService` * suggestions from review
This commit is contained in:
@@ -40,8 +40,7 @@ fn main() {
|
||||
|
||||
#[allow(clippy::let_and_return)]
|
||||
async fn app(request: Request<String>) -> Response {
|
||||
let mut router = Router::new().route("/api/", get(index)).into_service();
|
||||
|
||||
let mut router = Router::new().route("/api/", get(index));
|
||||
let response = router.call(request).await.unwrap();
|
||||
response
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user