impl HttpTryFrom<String> for HeaderValue (#236)

This commit is contained in:
Carl Lerche
2018-08-08 10:56:59 -07:00
committed by Sean McArthur
parent fc7ea617b5
commit 019c8529d5
+9
View File
@@ -512,6 +512,15 @@ impl<'a> HttpTryFrom<&'a [u8]> for HeaderValue {
}
}
impl HttpTryFrom<String> for HeaderValue {
type Error = InvalidHeaderValueBytes;
#[inline]
fn try_from(t: String) -> Result<Self, Self::Error> {
HeaderValue::from_shared(t.into())
}
}
impl HttpTryFrom<Bytes> for HeaderValue {
type Error = InvalidHeaderValueBytes;