Split RouterService off of Router (#1381)

This commit is contained in:
Jonas Platte
2022-09-22 12:10:55 +02:00
committed by GitHub
parent 18e3fac5d3
commit 69d64cecc3
26 changed files with 371 additions and 225 deletions
+3 -3
View File
@@ -5,7 +5,7 @@
//! ```
use axum::response::{IntoResponse, Response};
use axum::{http, routing::get, Router};
use axum::{http, routing::get, Router, RouterService};
use std::net::SocketAddr;
fn app() -> Router {
@@ -50,7 +50,7 @@ mod tests {
#[tokio::test]
async fn test_get() {
let app = app();
let app = app().into_service();
let response = app
.oneshot(Request::get("/get-head").body(Body::empty()).unwrap())
@@ -66,7 +66,7 @@ mod tests {
#[tokio::test]
async fn test_implicit_head() {
let app = app();
let app = app().into_service();
let response = app
.oneshot(Request::head("/get-head").body(Body::empty()).unwrap())