mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-24 00:00:16 +02:00
Split RouterService off of Router (#1381)
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user