summaryrefslogtreecommitdiffstats
path: root/examples/echo.rs
diff options
context:
space:
mode:
authorDavid Renshaw <david@sandstorm.io>2016-11-05 15:16:29 -0400
committerDavid Renshaw <david@sandstorm.io>2016-11-05 15:16:29 -0400
commit556143b7c6e6631ee34625f5361f595e2fe0733f (patch)
tree4766a3884918869202355fc7f78c6093fe2d21d0 /examples/echo.rs
parent614887b8c15943b4afae494af83a815058f128a3 (diff)
Simply echo example: split() can now happen on the main task.
Diffstat (limited to 'examples/echo.rs')
-rw-r--r--examples/echo.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/echo.rs b/examples/echo.rs
index d46cbd96..925449b3 100644
--- a/examples/echo.rs
+++ b/examples/echo.rs
@@ -48,8 +48,8 @@ fn main() {
// We use the `io::copy` future to copy all data from the
// reading half onto the writing half.
let done = socket.incoming().for_each(move |(socket, addr)| {
- let pair = futures::lazy(|| futures::finished(socket.split()));
- let amt = pair.and_then(|(reader, writer)| copy(reader, writer));
+ let (reader, writer) = socket.split();
+ let amt = copy(reader, writer);
// Once all that is done we print out how much we wrote, and then
// critically we *spawn* this future which allows it to run