mirror of
https://github.com/tokio-rs/bytes.git
synced 2026-08-16 00:00:15 +02:00
Implement Debug for Bytes
This commit is contained in:
+7
-1
@@ -1,5 +1,5 @@
|
||||
use {Buf, ByteStr, ByteBuf, SmallByteStr};
|
||||
use std::{mem, ops, ptr};
|
||||
use std::{fmt, mem, ops, ptr};
|
||||
use std::any::{Any, TypeId};
|
||||
use std::raw::TraitObject;
|
||||
use core::nonzero::NonZero;
|
||||
@@ -165,6 +165,12 @@ impl ops::Index<usize> for Bytes {
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for Bytes {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
||||
super::debug(self, "Bytes", fmt)
|
||||
}
|
||||
}
|
||||
|
||||
impl Clone for Bytes {
|
||||
fn clone(&self) -> Bytes {
|
||||
self.obj().clone()
|
||||
|
||||
Reference in New Issue
Block a user