Skip to content

Commit

Permalink
fix fmt
Browse files Browse the repository at this point in the history
Signed-off-by: Phani Sajja <[email protected]>
  • Loading branch information
sajjaphani committed May 3, 2024
1 parent 8c52b0c commit 9e46bf2
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/cli/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,17 @@ pub struct StaticFile<T>(pub T);

impl<T> IntoResponse for StaticFile<T>
where
T: Into<String>,
T: Into<String>,
{
fn into_response(self) -> Response {
let path = self.0.into();

match Asset::get(path.as_str()) {
Some(content) => {
let mime = mime_guess::from_path(path).first_or_octet_stream();
([(header::CONTENT_TYPE, mime.as_ref())], content.data).into_response()
}
None => (StatusCode::NOT_FOUND, "404 Not Found").into_response(),
fn into_response(self) -> Response {
let path = self.0.into();

match Asset::get(path.as_str()) {
Some(content) => {
let mime = mime_guess::from_path(path).first_or_octet_stream();
([(header::CONTENT_TYPE, mime.as_ref())], content.data).into_response()
}
None => (StatusCode::NOT_FOUND, "404 Not Found").into_response(),
}
}
}
}

0 comments on commit 9e46bf2

Please sign in to comment.