mirror of
https://github.com/ntex-rs/ntex.git
synced 2025-04-05 22:07:38 +03:00
Add Bytes<&Bytes> for Bytes impl
This commit is contained in:
parent
0217a2e835
commit
959d821edd
5 changed files with 16 additions and 18 deletions
|
@ -899,6 +899,12 @@ impl Deref for Bytes {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<&Bytes> for Bytes {
|
||||
fn from(src: &Bytes) -> Bytes {
|
||||
src.clone()
|
||||
}
|
||||
}
|
||||
|
||||
impl From<BytesMut> for Bytes {
|
||||
fn from(src: BytesMut) -> Bytes {
|
||||
src.freeze()
|
||||
|
@ -4045,8 +4051,7 @@ mod tests {
|
|||
|
||||
use super::*;
|
||||
|
||||
const LONG: &[u8] =
|
||||
b"mary had a little lamb, little lamb, little lamb, little lamb, little lamb, little lamb \
|
||||
const LONG: &[u8] = b"mary had a little lamb, little lamb, little lamb, little lamb, little lamb, little lamb \
|
||||
mary had a little lamb, little lamb, little lamb, little lamb, little lamb, little lamb \
|
||||
mary had a little lamb, little lamb, little lamb, little lamb, little lamb, little lamb";
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue