mirror of
https://github.com/openharmony/third_party_rust_http.git
synced 2026-07-19 14:43:33 -04:00
impl HttpTryFrom<String> for HeaderValue (#236)
This commit is contained in:
committed by
Sean McArthur
parent
fc7ea617b5
commit
019c8529d5
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user