Implement Debug for Bytes

This commit is contained in:
Carl Lerche
2015-02-17 12:40:15 -08:00
parent e39ba25a95
commit 7444721d98
4 changed files with 90 additions and 1 deletions
+7 -1
View File
@@ -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()