Use dyn Trait feature in examples & tests (#553)
This commit is contained in:
@@ -51,7 +51,7 @@ where
|
|||||||
File::open(path.as_ref().to_owned())
|
File::open(path.as_ref().to_owned())
|
||||||
.map_err(|err| println!("request error: {}", err))
|
.map_err(|err| println!("request error: {}", err))
|
||||||
.and_then(|file| {
|
.and_then(|file| {
|
||||||
let source: Box<Stream<Item = Bytes, Error = io::Error> + Send> =
|
let source: Box<dyn Stream<Item = Bytes, Error = io::Error> + Send> =
|
||||||
Box::new(FileSource::new(file));
|
Box::new(FileSource::new(file));
|
||||||
|
|
||||||
Client::new()
|
Client::new()
|
||||||
|
|||||||
@@ -239,7 +239,7 @@ fn gzip_case(response_size: usize, chunk_size: usize) {
|
|||||||
fn body_stream() {
|
fn body_stream() {
|
||||||
let _ = env_logger::try_init();
|
let _ = env_logger::try_init();
|
||||||
|
|
||||||
let source: Box<Stream<Item = Bytes, Error = io::Error> + Send>
|
let source: Box<dyn Stream<Item = Bytes, Error = io::Error> + Send>
|
||||||
= Box::new(futures::stream::iter_ok::<_, io::Error>(
|
= Box::new(futures::stream::iter_ok::<_, io::Error>(
|
||||||
vec![Bytes::from_static(b"123"), Bytes::from_static(b"4567")]));
|
vec![Bytes::from_static(b"123"), Bytes::from_static(b"4567")]));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user