From 92595e84a21eb7865923ea20dd131154496a3cb2 Mon Sep 17 00:00:00 2001 From: Laurent Arnoud Date: Fri, 22 Sep 2017 20:27:10 +0200 Subject: [PATCH] feat(header): add ContentType::xml() constructor --- src/header/common/content_type.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/header/common/content_type.rs b/src/header/common/content_type.rs index b77e475e..2949ec6e 100644 --- a/src/header/common/content_type.rs +++ b/src/header/common/content_type.rs @@ -68,12 +68,18 @@ impl ContentType { ContentType(mime::TEXT_PLAIN_UTF_8) } - /// A constructor to easily create a `Content-Type: text/html; charset=utf-8` header. + /// 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/xml` header. + #[inline] + pub fn xml() -> ContentType { + ContentType(mime::TEXT_XML) + } + /// A constructor to easily create a `Content-Type: application/www-form-url-encoded` header. #[inline] pub fn form_url_encoded() -> ContentType {