diff options
author | Alex Crichton <alex@alexcrichton.com> | 2016-09-07 13:53:18 -0700 |
---|---|---|
committer | Alex Crichton <alex@alexcrichton.com> | 2016-09-07 22:12:14 -0700 |
commit | e60002b653594c0a024733d1db0ce8d680e4f808 (patch) | |
tree | 88715659642478a777921873aa957116ca5bcfca /examples/echo.rs | |
parent | 6c045d31ac78df7b6b190935c2024c90b420da28 (diff) |
Tweak TaskIo wording and such
* Remove TaskIo
* task_split -> split
* TaskIoRead -> ReadHalf
* TaskIoWrite -> WriteHalf
Closes #18
Diffstat (limited to 'examples/echo.rs')
-rw-r--r-- | examples/echo.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/examples/echo.rs b/examples/echo.rs index 4c8417c8..4f46e5fc 100644 --- a/examples/echo.rs +++ b/examples/echo.rs @@ -9,7 +9,7 @@ use std::net::SocketAddr; use futures::Future; use futures::stream::Stream; -use tokio_core::io::{copy, TaskIo}; +use tokio_core::io::{copy, Io}; use tokio_core::net::TcpListener; use tokio_core::reactor::Core; @@ -35,8 +35,7 @@ fn main() { // We use the `io::copy` future to copy all data from the // reading half onto the writing half. socket.incoming().for_each(move |(socket, addr)| { - let socket = futures::lazy(|| futures::finished(TaskIo::new(socket))); - let pair = socket.map(|s| s.split()); + let pair = futures::lazy(|| futures::finished(socket.split())); let amt = pair.and_then(|(reader, writer)| copy(reader, writer)); // Once all that is done we print out how much we wrote, and then |