mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-19 00:00:14 +02:00
Move Html from axum-extra to axum (#2633)
This commit is contained in:
@@ -66,14 +66,6 @@ macro_rules! mime_response {
|
||||
};
|
||||
}
|
||||
|
||||
mime_response! {
|
||||
/// A HTML response.
|
||||
///
|
||||
/// Will automatically get `Content-Type: text/html; charset=utf-8`.
|
||||
Html,
|
||||
TEXT_HTML_UTF_8,
|
||||
}
|
||||
|
||||
mime_response! {
|
||||
/// A JavaScript response.
|
||||
///
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#![doc = include_str!("../docs/response.md")]
|
||||
|
||||
use axum_core::body::Body;
|
||||
use http::{header, HeaderValue};
|
||||
|
||||
mod redirect;
|
||||
@@ -40,7 +39,7 @@ pub struct Html<T>(pub T);
|
||||
|
||||
impl<T> IntoResponse for Html<T>
|
||||
where
|
||||
T: Into<Body>,
|
||||
T: IntoResponse,
|
||||
{
|
||||
fn into_response(self) -> Response {
|
||||
(
|
||||
@@ -48,7 +47,7 @@ where
|
||||
header::CONTENT_TYPE,
|
||||
HeaderValue::from_static(mime::TEXT_HTML_UTF_8.as_ref()),
|
||||
)],
|
||||
self.0.into(),
|
||||
self.0,
|
||||
)
|
||||
.into_response()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user