Skip to content
Snippets Groups Projects
Commit 01c1e05a authored by Florian Hartwig's avatar Florian Hartwig Committed by Carl Lerche
Browse files

Implement Debug for the various ByteBuf types

parent a76dd8ed
No related branches found
No related tags found
No related merge requests found
use {alloc, Bytes, SeqByteStr, MAX_CAPACITY};
use traits::{Buf, MutBuf, MutBufExt, ByteStr};
use std::{cmp, ptr};
use std::{cmp, fmt, ptr};
/*
*
......@@ -188,6 +188,12 @@ impl Buf for ByteBuf {
}
}
impl fmt::Debug for ByteBuf {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
self.bytes().fmt(fmt)
}
}
/*
*
* ===== ROByteBuf =====
......@@ -254,6 +260,12 @@ impl Buf for ROByteBuf {
}
}
impl fmt::Debug for ROByteBuf {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
self.bytes().fmt(fmt)
}
}
/*
*
* ===== MutByteBuf =====
......@@ -327,3 +339,9 @@ impl MutBuf for MutByteBuf {
&mut self.buf.mem.bytes_mut()[pos..lim]
}
}
impl fmt::Debug for MutByteBuf {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
self.bytes().fmt(fmt)
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment