style: apply rustfmt formatting fixes

This commit is contained in:
NetworkCats
2026-03-04 02:30:10 +08:00
parent cd762b33ab
commit a8f253088a
3 changed files with 8 additions and 10 deletions
+1 -3
View File
@@ -26,9 +26,7 @@ pub async fn security_headers(request: Request, next: Next) -> Response {
);
headers.insert(
header::HeaderName::from_static("permissions-policy"),
HeaderValue::from_static(
"camera=(), microphone=(), geolocation=(), interest-cohort=()",
),
HeaderValue::from_static("camera=(), microphone=(), geolocation=(), interest-cohort=()"),
);
headers.insert(
header::HeaderName::from_static("cross-origin-opener-policy"),
+1 -1
View File
@@ -1,6 +1,6 @@
use axum::Router;
use axum::middleware;
use axum::routing::get;
use axum::Router;
use crate::handlers::{self, AppState};
use crate::middleware::security_headers;
+6 -6
View File
@@ -2,8 +2,8 @@ use std::collections::HashMap;
use std::sync::LazyLock;
use axum::extract::Path;
use axum::http::header::{self, HeaderValue};
use axum::http::StatusCode;
use axum::http::header::{self, HeaderValue};
use axum::response::{IntoResponse, Response};
use static_files::Resource;
@@ -13,10 +13,7 @@ include!(concat!(env!("OUT_DIR"), "/generated.rs"));
static ASSETS: LazyLock<HashMap<&'static str, Resource>> = LazyLock::new(generate);
pub fn asset_version(filename: &str) -> u64 {
ASSETS
.get(filename)
.map(|r| r.modified)
.unwrap_or(0)
ASSETS.get(filename).map(|r| r.modified).unwrap_or(0)
}
pub async fn serve_static(Path(path): Path<String>) -> Response {
@@ -26,7 +23,10 @@ pub async fn serve_static(Path(path): Path<String>) -> Response {
(
[
(header::CONTENT_TYPE, HeaderValue::from_static(resource.mime_type)),
(
header::CONTENT_TYPE,
HeaderValue::from_static(resource.mime_type),
),
(
header::CACHE_CONTROL,
HeaderValue::from_static("public, max-age=31536000, immutable"),