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
+4 -4
View File
@@ -61,7 +61,7 @@ mod tests {
#[tokio::test]
async fn hello_world() {
let app = app();
let app = app().into_service();
// `Router` implements `tower::Service<Request<Body>>` so we can
// call it like any tower service, no need to run an HTTP server.
@@ -78,7 +78,7 @@ mod tests {
#[tokio::test]
async fn json() {
let app = app();
let app = app().into_service();
let response = app
.oneshot(
@@ -103,7 +103,7 @@ mod tests {
#[tokio::test]
async fn not_found() {
let app = app();
let app = app().into_service();
let response = app
.oneshot(
@@ -154,7 +154,7 @@ mod tests {
// in multiple request
#[tokio::test]
async fn multiple_request() {
let mut app = app();
let mut app = app().into_service();
let request = Request::builder().uri("/").body(Body::empty()).unwrap();
let response = app.ready().await.unwrap().call(request).await.unwrap();