merge hex & debug into fmt (#357)

This commit is contained in:
南浦月
2020-01-23 10:08:40 -08:00
committed by Sean McArthur
parent f9ebf74091
commit 3853a1fac4
7 changed files with 61 additions and 62 deletions
-7
View File
@@ -9,7 +9,6 @@ use alloc::{vec::Vec, string::String, boxed::Box, borrow::{Borrow, BorrowMut}};
use crate::{Bytes, Buf, BufMut};
use crate::bytes::Vtable;
use crate::buf::IntoIter;
use crate::debug;
use crate::loom::sync::atomic::{self, AtomicPtr, AtomicUsize, Ordering};
/// A unique reference to a contiguous slice of memory.
@@ -1074,12 +1073,6 @@ impl Default for BytesMut {
}
}
impl fmt::Debug for BytesMut {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt::Debug::fmt(&debug::BsDebug(&self.as_slice()), fmt)
}
}
impl hash::Hash for BytesMut {
fn hash<H>(&self, state: &mut H) where H: hash::Hasher {
let s: &[u8] = self.as_ref();