mirror of
https://github.com/openharmony/third_party_rust_http.git
synced 2026-07-19 22:53:59 -04:00
@@ -8,6 +8,11 @@ pub struct ByteStr {
|
||||
}
|
||||
|
||||
impl ByteStr {
|
||||
#[inline]
|
||||
pub fn new() -> ByteStr {
|
||||
ByteStr { bytes: Bytes::new() }
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn from_static(val: &'static str) -> ByteStr {
|
||||
ByteStr { bytes: Bytes::from_static(val.as_bytes()) }
|
||||
@@ -42,3 +47,9 @@ impl<'a> From<&'a str> for ByteStr {
|
||||
ByteStr { bytes: Bytes::from(src) }
|
||||
}
|
||||
}
|
||||
|
||||
impl From<ByteStr> for Bytes {
|
||||
fn from(src: ByteStr) -> Self {
|
||||
src.bytes
|
||||
}
|
||||
}
|
||||
|
||||
+843
-287
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user