From d02dd08530bbedada7aabb5964a1104a3c6349c3 Mon Sep 17 00:00:00 2001 From: prakash-bhatt-rs Date: Tue, 13 Aug 2024 17:50:17 +0530 Subject: [PATCH] fix: Infallible lintining error (#318) * Fix: Infallible lintining error * Update: unnecessary parentheses around block return value --- ssr/src/fallback.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/ssr/src/fallback.rs b/ssr/src/fallback.rs index 3e95a265..834667b3 100644 --- a/ssr/src/fallback.rs +++ b/ssr/src/fallback.rs @@ -22,7 +22,7 @@ pub async fn file_and_error_handler( res.into_response() } else { let handler = - leptos_axum::render_app_to_stream(options.to_owned(), move || view! { }); + leptos_axum::render_app_to_stream(options.to_owned(), move || view! { }); handler(req).await.into_response() } } @@ -34,11 +34,5 @@ async fn get_static_file(uri: Uri, root: &str) -> Result, (Status .unwrap(); // `ServeDir` implements `tower::Service` so we can call it with `tower::ServiceExt::oneshot` // This path is relative to the cargo root - match ServeDir::new(root).oneshot(req).await { - Ok(res) => Ok(res.into_response()), - Err(err) => Err(( - StatusCode::INTERNAL_SERVER_ERROR, - format!("Something went wrong: {err}"), - )), - } + Ok(ServeDir::new(root).oneshot(req).await.into_response()) }