diff --git a/Cargo.toml b/Cargo.toml index d8cfa62..5967a76 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bytesutil" -version = "0.2.0" +version = "0.3.0" authors = ["Yuri Edward "] edition = "2021" description = "Yet another byte utility for Rust" diff --git a/src/buffer.rs b/src/buffer.rs index 04c894f..175d555 100644 --- a/src/buffer.rs +++ b/src/buffer.rs @@ -26,6 +26,8 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +use core::fmt::{Debug, Display}; + use crate::{ReadBytes, WriteBytes}; /// A java-like wrapper over a buffer of bytes. @@ -96,6 +98,18 @@ impl PartialEq for ByteBuf { impl Eq for ByteBuf {} +impl Debug for ByteBuf { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + self.inner.fmt(f) + } +} + +impl Display for ByteBuf { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + self.inner.fmt(f) + } +} + /// A shortcut to create a stack allocated fixed size [ByteBuf](ByteBuf) pub type StaticByteBuf = ByteBuf<[u8; N]>;