From 72e274c52afa4ac32b0c09c2203b17b895af47bf Mon Sep 17 00:00:00 2001 From: Sean McArthur Date: Tue, 12 May 2015 18:23:55 -0700 Subject: [PATCH] refactor(header): add #[inline] to new header constructors --- src/header/common/connection.rs | 2 ++ src/header/common/content_type.rs | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/src/header/common/connection.rs b/src/header/common/connection.rs index cf544e9c..74cfd86e 100644 --- a/src/header/common/connection.rs +++ b/src/header/common/connection.rs @@ -73,11 +73,13 @@ header! { impl Connection { /// A constructor to easily create a `Connection: close` header. + #[inline] pub fn close() -> Connection { Connection(vec![ConnectionOption::Close]) } /// A constructor to easily create a `Connection: keep-alive` header. + #[inline] pub fn keep_alive() -> Connection { Connection(vec![ConnectionOption::KeepAlive]) } diff --git a/src/header/common/content_type.rs b/src/header/common/content_type.rs index 1d9e2841..1d6805d0 100644 --- a/src/header/common/content_type.rs +++ b/src/header/common/content_type.rs @@ -36,26 +36,31 @@ header! { impl ContentType { /// A constructor to easily create a `Content-Type: application/json; charset=utf-8` header. + #[inline] pub fn json() -> ContentType { ContentType(mime!(Application/Json; Charset=Utf8)) } /// A constructor to easily create a `Content-Type: text/plain; charset=utf-8` header. + #[inline] pub fn plaintext() -> ContentType { ContentType(mime!(Text/Plain; Charset=Utf8)) } /// A constructor to easily create a `Content-Type: text/html; charset=utf-8` header. + #[inline] pub fn html() -> ContentType { ContentType(mime!(Text/Html; Charset=Utf8)) } /// A constructor to easily create a `Content-Type: image/jpeg` header. + #[inline] pub fn jpeg() -> ContentType { ContentType(mime!(Image/Jpeg)) } /// A constructor to easily create a `Content-Type: image/png` header. + #[inline] pub fn png() -> ContentType { ContentType(mime!(Image/Png)) }