mirror of
https://github.com/tokio-rs/bytes.git
synced 2026-08-14 00:00:13 +02:00
added clone to ByteBuf and BytesMut along with simple clone test
This commit is contained in:
@@ -215,3 +215,13 @@ impl fmt::Write for ByteBuf {
|
||||
fmt::write(self, args)
|
||||
}
|
||||
}
|
||||
|
||||
impl Clone for ByteBuf {
|
||||
fn clone(&self) -> Self {
|
||||
ByteBuf {
|
||||
mem: self.mem.clone(),
|
||||
rd: self.rd,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user