cargo fmt

This commit is contained in:
imbolc 2024-05-14 16:40:29 +06:00
parent f622f12bba
commit c6f8bcb504

View file

@ -1,16 +1,18 @@
use crate::{ use std::sync::Arc;
headers::{HX_REQUEST_STR, HX_TARGET_STR},
HxError,
};
use axum::{extract::Request, middleware::Next, response::Response}; use axum::{extract::Request, middleware::Next, response::Response};
use axum_core::response::IntoResponse; use axum_core::response::IntoResponse;
use http::{ use http::{
header::{HeaderValue, VARY}, header::{HeaderValue, VARY},
Extensions, Extensions,
}; };
use std::sync::Arc;
use tokio::sync::oneshot::{self, Receiver, Sender}; use tokio::sync::oneshot::{self, Receiver, Sender};
use crate::{
headers::{HX_REQUEST_STR, HX_TARGET_STR},
HxError,
};
const MIDDLEWARE_DOUBLE_USE: &str = const MIDDLEWARE_DOUBLE_USE: &str =
"Configuration error: `axum_httpx::vary_middleware` is used twice"; "Configuration error: `axum_httpx::vary_middleware` is used twice";
@ -91,10 +93,10 @@ pub async fn vary_middleware(mut request: Request, next: Next) -> Response {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use crate::{HxRequest, HxTarget};
use axum::{routing::get, Router}; use axum::{routing::get, Router};
use super::*; use super::*;
use crate::{HxRequest, HxTarget};
fn vary_headers(resp: &axum_test::TestResponse) -> Vec<HeaderValue> { fn vary_headers(resp: &axum_test::TestResponse) -> Vec<HeaderValue> {
resp.iter_headers_by_name("vary").cloned().collect() resp.iter_headers_by_name("vary").cloned().collect()