diff options
author | Carl Lerche <me@carllerche.com> | 2018-02-06 07:26:21 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-06 07:26:21 -0800 |
commit | f0ea9d6f4c0a734ac4c235630f3d8cc51fb48f51 (patch) | |
tree | 011aae238269ce6ba1cf29013126e4e45fea4cd4 /examples/connect.rs | |
parent | 567887cc75170437f75f19f5966f2b32bf49ab72 (diff) |
Switch back to futures from crates.io (#113)
Doing so requires copying the `current_thread` executor from GitHub into
the repo.
Diffstat (limited to 'examples/connect.rs')
-rw-r--r-- | examples/connect.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/connect.rs b/examples/connect.rs index f0619fbd..a4160449 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::{future, Sink, 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(); - future::blocking(stdout.for_each(|chunk| { + 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<Vec<u8>>) { Ok(n) => n, }; buf.truncate(n); - tx = match future::blocking(tx.send(buf)).wait() { + tx = match tx.send(buf).wait() { Ok(tx) => tx, Err(_) => break, }; |