Skip to content

Commit 5eeb66f

Browse files
committed
impl From<ContentCoding> for HeaderValue
1 parent 56bed20 commit 5eeb66f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/common/content_coding.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use HeaderValue;
2+
13
macro_rules! define_content_coding {
24
($($coding:ident; $str:expr,)+) => {
35
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
@@ -80,6 +82,14 @@ macro_rules! define_content_coding {
8082
}
8183
}
8284
}
85+
86+
impl From<ContentCoding> for HeaderValue {
87+
fn from(coding: ContentCoding) -> HeaderValue {
88+
match coding {
89+
$(ContentCoding::$coding => HeaderValue::from_static($str),)+
90+
}
91+
}
92+
}
8393
}
8494
}
8595

0 commit comments

Comments
 (0)