Skip to content

Commit

Permalink
Merge pull request rust-lang#90 from simbiont666/fix-tutorial
Browse files Browse the repository at this point in the history
Fix typo in tutorial
  • Loading branch information
alexcrichton authored Aug 22, 2016
2 parents a149651 + 589cbb5 commit 9337886
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions TUTORIAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ fn main() {
futures_io::read_to_end(socket, Vec::new())
});

let data = lp.run(response).unwrap();
let (_, data) = lp.run(response).unwrap();
println!("{}", String::from_utf8_lossy(&data));
}
```
Expand Down Expand Up @@ -266,14 +266,14 @@ To actually execute our future and drive it to completion we'll need to run the
event loop:

```rust
let data = lp.run(response).unwrap();
let (_, data) = lp.run(response).unwrap();
println!("{}", String::from_utf8_lossy(&data));
```

Here we pass our `response` future, our entire HTTP request, and we pass it to
the event loop, [asking it to resolve the future][`loop_run`]. The event loop will
then run until the future has been resolved, returning the result of the future
which in this case is `io::Result<Vec<u8>>`.
which in this case is `io::Result<(TcpStream, Vec<u8>)>`.

[`loop_run`]: http://alexcrichton.com/futures-rs/futures_mio/struct.Loop.html#method.run

Expand Down Expand Up @@ -1102,4 +1102,3 @@ A [`LoopData`] can be created through one of two methods:

Task-local data and event-loop data provide the ability for futures to easily
share sendable and non-sendable data amongst many futures.

0 comments on commit 9337886

Please sign in to comment.