diff --git a/src/middleware.rs b/src/middleware.rs index 72fb7a7..3bf5a14 100644 --- a/src/middleware.rs +++ b/src/middleware.rs @@ -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"), diff --git a/src/routes.rs b/src/routes.rs index bd9e6d5..7358f61 100644 --- a/src/routes.rs +++ b/src/routes.rs @@ -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; diff --git a/src/static_assets.rs b/src/static_assets.rs index b187e14..661fa31 100644 --- a/src/static_assets.rs +++ b/src/static_assets.rs @@ -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> = 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) -> Response { @@ -26,7 +23,10 @@ pub async fn serve_static(Path(path): Path) -> 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"),