File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -73,11 +73,13 @@ header! {
73
73
74
74
impl Connection {
75
75
/// A constructor to easily create a `Connection: close` header.
76
+ #[ inline]
76
77
pub fn close ( ) -> Connection {
77
78
Connection ( vec ! [ ConnectionOption :: Close ] )
78
79
}
79
80
80
81
/// A constructor to easily create a `Connection: keep-alive` header.
82
+ #[ inline]
81
83
pub fn keep_alive ( ) -> Connection {
82
84
Connection ( vec ! [ ConnectionOption :: KeepAlive ] )
83
85
}
Original file line number Diff line number Diff line change @@ -36,26 +36,31 @@ header! {
36
36
37
37
impl ContentType {
38
38
/// A constructor to easily create a `Content-Type: application/json; charset=utf-8` header.
39
+ #[ inline]
39
40
pub fn json ( ) -> ContentType {
40
41
ContentType ( mime ! ( Application /Json ; Charset =Utf8 ) )
41
42
}
42
43
43
44
/// A constructor to easily create a `Content-Type: text/plain; charset=utf-8` header.
45
+ #[ inline]
44
46
pub fn plaintext ( ) -> ContentType {
45
47
ContentType ( mime ! ( Text /Plain ; Charset =Utf8 ) )
46
48
}
47
49
48
50
/// A constructor to easily create a `Content-Type: text/html; charset=utf-8` header.
51
+ #[ inline]
49
52
pub fn html ( ) -> ContentType {
50
53
ContentType ( mime ! ( Text /Html ; Charset =Utf8 ) )
51
54
}
52
55
53
56
/// A constructor to easily create a `Content-Type: image/jpeg` header.
57
+ #[ inline]
54
58
pub fn jpeg ( ) -> ContentType {
55
59
ContentType ( mime ! ( Image /Jpeg ) )
56
60
}
57
61
58
62
/// A constructor to easily create a `Content-Type: image/png` header.
63
+ #[ inline]
59
64
pub fn png ( ) -> ContentType {
60
65
ContentType ( mime ! ( Image /Png ) )
61
66
}
You can’t perform that action at this time.
0 commit comments