mirror of
https://github.com/fafhrd91/actix-net
synced 2024-11-24 03:42:59 +01:00
add unsafe from_bytes_unchecked
This commit is contained in:
parent
40fbbb9c32
commit
393cf1ab25
@ -30,6 +30,11 @@ impl ByteString {
|
||||
pub fn from_static(src: &'static str) -> ByteString {
|
||||
Self(Bytes::from_static(src.as_ref()))
|
||||
}
|
||||
|
||||
/// Creates a new `ByteString` from a Bytes.
|
||||
pub unsafe fn from_bytes_unchecked(src: Bytes) -> ByteString {
|
||||
Self(src)
|
||||
}
|
||||
}
|
||||
|
||||
impl PartialEq<str> for ByteString {
|
||||
|
Loading…
Reference in New Issue
Block a user