From 630e0b1b8eafa9da51d44d7b4a419f20b8a2501b Mon Sep 17 00:00:00 2001 From: LukeMathWalker Date: Tue, 26 Oct 2021 08:56:45 +0100 Subject: [PATCH] Update the existing `html` method. --- CHANGES.md | 4 ++-- src/http/header/content_type.rs | 8 +------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index aeb6e83e0..3be41d468 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,8 +1,8 @@ # Changes ## Unreleased - 2021-xx-xx -### Added -* `ContentType::html_utf8`, a constructor to easily create a `Content-Type: text/html; charset=utf-8` header; +### Changed +* `ContentType::html` now returns `Content-Type: text/html; charset=utf-8` instead of `Content-Type: text/html`. ## 4.0.0-beta.10 - 2021-10-20 diff --git a/src/http/header/content_type.rs b/src/http/header/content_type.rs index 6971f7d66..230460003 100644 --- a/src/http/header/content_type.rs +++ b/src/http/header/content_type.rs @@ -74,16 +74,10 @@ impl ContentType { ContentType(mime::TEXT_PLAIN_UTF_8) } - /// A constructor to easily create a `Content-Type: text/html` header. - #[inline] - pub fn html() -> ContentType { - ContentType(mime::TEXT_HTML) - } - /// A constructor to easily create a `Content-Type: text/html; charset=utf-8` /// header. #[inline] - pub fn html_utf8() -> ContentType { + pub fn html() -> ContentType { ContentType(mime::TEXT_HTML_UTF_8) }