From c60c1709d6b3313bf3d6bd1f05dcd502eeeb20bc Mon Sep 17 00:00:00 2001 From: StellarisW Date: Tue, 30 Jul 2024 14:23:39 +0800 Subject: [PATCH] tests: add tests for layer and middleware --- volo-http/src/server/middleware.rs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/volo-http/src/server/middleware.rs b/volo-http/src/server/middleware.rs index 8a746731..5d2be3a8 100644 --- a/volo-http/src/server/middleware.rs +++ b/volo-http/src/server/middleware.rs @@ -523,20 +523,12 @@ pub mod middleware_tests { let route = Route::new(get_service(service_fn(service))); let service = from_fn(converter).layer(route); - let resp = service + let _: Result = service .call( &mut empty_cx(), - simple_req::<_, String>(Method::GET, "/", String::from("")), + simple_req(Method::GET, "/", String::from("")), ) .await; - match resp { - Ok(resp) => { - let _: String = resp.into_string().await.unwrap(); - } - Err(err) => { - let _: Infallible = err; - } - }; } async fn index_handler() -> &'static str {