Apply formatting and satisfy lints
This commit is contained in:
parent
4db4c703d1
commit
82f1f0c63c
5 changed files with 35 additions and 18 deletions
|
|
@ -6,7 +6,6 @@ use axum::{
|
|||
use crate::formats::{Format, populate_graph, serialize_graph};
|
||||
use crate::handlers;
|
||||
|
||||
#[expect(clippy::unused_async)]
|
||||
pub async fn file(file_path: &str, content_type: &str) -> Response<Body> {
|
||||
let content = match std::fs::read(file_path) {
|
||||
Ok(s) => s,
|
||||
|
|
@ -23,15 +22,19 @@ pub async fn file(file_path: &str, content_type: &str) -> Response<Body> {
|
|||
if let Some(h) = response.headers_mut().insert(header, header_value) {
|
||||
crate::dev::log(
|
||||
&file,
|
||||
&format!("Overwrote existing header {h:?} because a header for \
|
||||
the same key existed")
|
||||
&format!(
|
||||
"Overwrote existing header {h:?} because a header for \
|
||||
the same key existed"
|
||||
),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
crate::dev::log(
|
||||
&file,
|
||||
&format!("[file_handler] Failed to create content type \
|
||||
header value from {content_type}")
|
||||
&format!(
|
||||
"Failed to create content type \
|
||||
header value from {content_type}"
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,15 +20,17 @@ pub fn make_response(
|
|||
{
|
||||
crate::dev::log(
|
||||
&make_response,
|
||||
&format!("Overwrote header {overwritten:?} \
|
||||
&format!(
|
||||
"Overwrote header {overwritten:?} \
|
||||
because another for key {} already existed",
|
||||
header.0)
|
||||
header.0
|
||||
),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
crate::dev::log(
|
||||
&make_response,
|
||||
&format!("Failed to wrap header value {}", header.1)
|
||||
&format!("Failed to wrap header value {}", header.1),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ pub(super) fn by_filename(
|
|||
make_response(&body, status_code, &[(header::CONTENT_TYPE, "text/html")])
|
||||
}
|
||||
|
||||
#[expect(clippy::unused_async)]
|
||||
pub async fn fixed(name: &str) -> Response<Body> {
|
||||
by_filename(name, &tera::Context::new(), 500, None, false)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue