Skip to content

Commit

Permalink
Move Html from axum-extra to axum (#2633)
Browse files Browse the repository at this point in the history
  • Loading branch information
creativcoder authored Sep 29, 2024
1 parent 3df15fd commit 3eb8854
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
8 changes: 0 additions & 8 deletions axum-extra/src/response/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down
5 changes: 2 additions & 3 deletions axum/src/response/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![doc = include_str!("../docs/response.md")]

use axum_core::body::Body;
use http::{header, HeaderValue};

mod redirect;
Expand Down Expand Up @@ -40,15 +39,15 @@ pub struct Html<T>(pub T);

impl<T> IntoResponse for Html<T>
where
T: Into<Body>,
T: IntoResponse,
{
fn into_response(self) -> Response {
(
[(
header::CONTENT_TYPE,
HeaderValue::from_static(mime::TEXT_HTML_UTF_8.as_ref()),
)],
self.0.into(),
self.0,
)
.into_response()
}
Expand Down

0 comments on commit 3eb8854

Please sign in to comment.