axum-extra: Make axum optional dependency (#3485)

This commit is contained in:
tottoto
2025-09-20 22:50:56 +02:00
committed by GitHub
parent 40e9d7b22a
commit d184798937
24 changed files with 90 additions and 46 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
use axum::response::IntoResponse;
use axum_core::response::IntoResponse;
use http::{header, HeaderMap, HeaderValue};
use tracing::error;
@@ -79,7 +79,7 @@ impl<T> IntoResponse for Attachment<T>
where
T: IntoResponse,
{
fn into_response(self) -> axum::response::Response {
fn into_response(self) -> axum_core::response::Response {
let mut headers = HeaderMap::new();
if let Some(content_type) = self.content_type {
+2 -4
View File
@@ -1,10 +1,8 @@
use std::sync::Arc;
use axum::{
http::{header, HeaderValue, StatusCode},
response::{IntoResponse, Response},
};
use axum_core::response::{IntoResponse, Response};
use bytes::{BufMut, Bytes, BytesMut};
use http::{header, HeaderValue, StatusCode};
use serde_core::Serialize;
/// A response type that holds a JSON in serialized form.
+1 -1
View File
@@ -1,4 +1,4 @@
use axum::{
use axum_core::{
body,
response::{IntoResponse, Response},
BoxError,
+3 -3
View File
@@ -60,11 +60,11 @@ macro_rules! mime_response {
#[must_use]
pub struct $ident<T>(pub T);
impl<T> axum::response::IntoResponse for $ident<T>
impl<T> axum_core::response::IntoResponse for $ident<T>
where
T: axum::response::IntoResponse,
T: axum_core::response::IntoResponse,
{
fn into_response(self) -> axum::response::Response {
fn into_response(self) -> axum_core::response::Response {
(
[(
http::header::CONTENT_TYPE,
+1 -1
View File
@@ -1,6 +1,6 @@
//! Generate forms to use in responses.
use axum::response::{IntoResponse, Response};
use axum_core::response::{IntoResponse, Response};
use fastrand;
use http::{header, HeaderMap, StatusCode};
use mime::Mime;