diff options
Diffstat (limited to 'src/buf/ext/mod.rs')
-rw-r--r-- | src/buf/ext/mod.rs | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/buf/ext/mod.rs b/src/buf/ext/mod.rs index 7b0bdab..7d61814 100644 --- a/src/buf/ext/mod.rs +++ b/src/buf/ext/mod.rs @@ -10,9 +10,9 @@ mod take; #[cfg(feature = "std")] mod writer; +pub use self::chain::Chain; pub use self::limit::Limit; pub use self::take::Take; -pub use self::chain::Chain; #[cfg(feature = "std")] pub use self::{reader::Reader, writer::Writer}; @@ -41,7 +41,8 @@ pub trait BufExt: Buf { /// assert_eq!(dst, b" world"); /// ``` fn take(self, limit: usize) -> Take<Self> - where Self: Sized + where + Self: Sized, { take::new(self, limit) } @@ -62,7 +63,8 @@ pub trait BufExt: Buf { /// assert_eq!(full.bytes(), b"hello world"); /// ``` fn chain<U: Buf>(self, next: U) -> Chain<Self, U> - where Self: Sized + where + Self: Sized, { Chain::new(self, next) } @@ -91,7 +93,10 @@ pub trait BufExt: Buf { /// assert_eq!(&dst[..11], &b"hello world"[..]); /// ``` #[cfg(feature = "std")] - fn reader(self) -> Reader<Self> where Self: Sized { + fn reader(self) -> Reader<Self> + where + Self: Sized, + { reader::new(self) } } @@ -114,7 +119,8 @@ pub trait BufMutExt: BufMut { /// assert_eq!(dst.remaining_mut(), 10); /// ``` fn limit(self, limit: usize) -> Limit<Self> - where Self: Sized + where + Self: Sized, { limit::new(self, limit) } @@ -142,7 +148,10 @@ pub trait BufMutExt: BufMut { /// assert_eq!(*buf, b"hello world"[..]); /// ``` #[cfg(feature = "std")] - fn writer(self) -> Writer<Self> where Self: Sized { + fn writer(self) -> Writer<Self> + where + Self: Sized, + { writer::new(self) } @@ -167,7 +176,8 @@ pub trait BufMutExt: BufMut { /// assert_eq!(&b[..], b" world"); /// ``` fn chain_mut<U: BufMut>(self, next: U) -> Chain<Self, U> - where Self: Sized + where + Self: Sized, { Chain::new(self, next) } |