Move "extra" methods to extension traits (#306)

This commit is contained in:
Sean McArthur
2019-10-31 09:39:58 -07:00
committed by GitHub
parent 2ac72333fa
commit 96268a80d4
11 changed files with 170 additions and 232 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
#![deny(warnings, rust_2018_idioms)]
use bytes::{Buf, BufMut, Bytes, BytesMut};
use bytes::buf::Chain;
use bytes::buf::BufExt;
use std::io::IoSlice;
#[test]
@@ -19,7 +19,7 @@ fn writing_chained() {
let mut b = BytesMut::with_capacity(64);
{
let mut buf = Chain::new(&mut a, &mut b);
let mut buf = (&mut a).chain(&mut b);
for i in 0u8..128 {
buf.put_u8(i);