remove ext traits (#431)

This commit is contained in:
Carl Lerche
2020-10-16 15:16:23 -07:00
committed by GitHub
parent 447530b8a6
commit 94c543f74b
12 changed files with 199 additions and 209 deletions
+3 -3
View File
@@ -3,13 +3,13 @@
use std::io::{BufRead, Read};
use bytes::buf::BufExt;
use bytes::Buf;
#[test]
fn read() {
let buf1 = &b"hello "[..];
let buf2 = &b"world"[..];
let buf = BufExt::chain(buf1, buf2); // Disambiguate with Read::chain
let buf = Buf::chain(buf1, buf2); // Disambiguate with Read::chain
let mut buffer = Vec::new();
buf.reader().read_to_end(&mut buffer).unwrap();
assert_eq!(b"hello world", &buffer[..]);
@@ -19,7 +19,7 @@ fn read() {
fn buf_read() {
let buf1 = &b"hell"[..];
let buf2 = &b"o\nworld"[..];
let mut reader = BufExt::chain(buf1, buf2).reader();
let mut reader = Buf::chain(buf1, buf2).reader();
let mut line = String::new();
reader.read_line(&mut line).unwrap();
assert_eq!("hello\n", &line);