Merge pull request 'Convert Infaliable Result into Option and handle' (#90) from 89_fix-warning-with-handling-infaliable-result-in-fileserv-rs into main
Reviewed-on: LibreTunes/LibreTunes#90
This commit is contained in:
commit
266bba05aa
@ -29,11 +29,11 @@ cfg_if! { if #[cfg(feature = "ssr")] {
|
||||
let req = Request::builder().uri(uri.clone()).body(Body::empty()).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((
|
||||
match ServeDir::new(root).oneshot(req).await.ok() {
|
||||
Some(res) => Ok(res.into_response()),
|
||||
None => Err((
|
||||
StatusCode::INTERNAL_SERVER_ERROR,
|
||||
format!("Something went wrong: {err}"),
|
||||
format!("Something went wrong"),
|
||||
)),
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user