Freshen up buf API

This commit is contained in:
Carl Lerche
2016-06-08 14:48:49 -07:00
parent 12dfc417ce
commit 270d2e2844
16 changed files with 156 additions and 230 deletions
+3 -3
View File
@@ -1,4 +1,4 @@
use bytes::{Buf, MutBuf, MutBufExt};
use bytes::{Buf, MutBuf};
use std::usize;
use std::io::{Cursor};
@@ -35,7 +35,7 @@ pub fn test_vec_as_mut_buf() {
assert!(buf.mut_bytes().len() >= 64);
}
buf.write(&b"zomg"[..]).unwrap();
buf.copy_from(&b"zomg"[..]).unwrap();
assert_eq!(&buf, b"zomg");
@@ -43,7 +43,7 @@ pub fn test_vec_as_mut_buf() {
assert_eq!(buf.capacity(), 64);
for _ in 0..16 {
buf.write(&b"zomg"[..]).unwrap();
buf.copy_from(&b"zomg"[..]).unwrap();
}
assert_eq!(buf.len(), 68);