From 2e94b658ed161ef7207a8decb20564556e9883f8 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Thu, 1 Feb 2018 10:31:07 -0800 Subject: Track futures tokio-reform branch (#88) This patch also updates tests and examples to remove deprecated API usage. --- examples/connect.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'examples/connect.rs') diff --git a/examples/connect.rs b/examples/connect.rs index 1bdc1af4..f0619fbd 100644 --- a/examples/connect.rs +++ b/examples/connect.rs @@ -26,7 +26,7 @@ use std::net::SocketAddr; use std::thread; use futures::sync::mpsc; -use futures::{Sink, Future, Stream}; +use futures::{future, Sink, Stream}; use futures_cpupool::CpuPool; fn main() { @@ -71,9 +71,9 @@ fn main() { // loop. In this case, though, we know it's ok as the event loop isn't // otherwise running anything useful. let mut out = io::stdout(); - stdout.for_each(|chunk| { + future::blocking(stdout.for_each(|chunk| { out.write_all(&chunk) - }).wait().unwrap(); + })).wait().unwrap(); } mod tcp { @@ -244,7 +244,7 @@ fn read_stdin(mut tx: mpsc::Sender>) { Ok(n) => n, }; buf.truncate(n); - tx = match tx.send(buf).wait() { + tx = match future::blocking(tx.send(buf)).wait() { Ok(tx) => tx, Err(_) => break, }; -- cgit v1.2.3