mirror of
https://github.com/tokio-rs/bytes.git
synced 2026-08-07 00:00:13 +02:00
implement Default for Bytes and BytesMut (#110)
This commit is contained in:
committed by
Carl Lerche
parent
e5c7ef3b86
commit
37f6cabd96
@@ -742,6 +742,13 @@ impl Ord for Bytes {
|
||||
impl Eq for Bytes {
|
||||
}
|
||||
|
||||
impl Default for Bytes {
|
||||
#[inline]
|
||||
fn default() -> Bytes {
|
||||
Bytes::new()
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for Bytes {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
||||
fmt::Debug::fmt(&debug::BsDebug(&self.inner.as_ref()), fmt)
|
||||
@@ -1292,6 +1299,13 @@ impl Ord for BytesMut {
|
||||
impl Eq for BytesMut {
|
||||
}
|
||||
|
||||
impl Default for BytesMut {
|
||||
#[inline]
|
||||
fn default() -> BytesMut {
|
||||
BytesMut::with_capacity(0)
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for BytesMut {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
||||
fmt::Debug::fmt(&debug::BsDebug(&self.inner.as_ref()), fmt)
|
||||
|
||||
Reference in New Issue
Block a user