diff options
author | Carl Lerche <me@carllerche.com> | 2018-01-30 13:01:34 -0800 |
---|---|---|
committer | Alex Crichton <alex@alexcrichton.com> | 2018-01-30 15:01:34 -0600 |
commit | ae627db266600f8d010b6eeb9d1be0fff677f0ce (patch) | |
tree | e9c020593a2e63a20ba39a5c426e42e69a8920fd /examples/proxy.rs | |
parent | f4ec9a6360c5e2d3066dc5b278f116c8febe701c (diff) |
Change `net::Incoming` signature to match std. (#89)
std's `Incoming` iterator yields `TcpStream` instances. This patch
updates the `Incoming` future to match this signature.
This changes the yielded value from `(TcpStream, SocketAddr)` ->
`TcpStream`.
Diffstat (limited to 'examples/proxy.rs')
-rw-r--r-- | examples/proxy.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/proxy.rs b/examples/proxy.rs index c64ead6f..98b86e9f 100644 --- a/examples/proxy.rs +++ b/examples/proxy.rs @@ -48,7 +48,7 @@ fn main() { println!("Listening on: {}", listen_addr); println!("Proxying to: {}", server_addr); - let done = socket.incoming().for_each(move |(client, client_addr)| { + let done = socket.incoming().for_each(move |client| { let server = TcpStream::connect(&server_addr); let amounts = server.and_then(move |server| { // Create separate read/write handles for the TCP clients that we're @@ -82,8 +82,8 @@ fn main() { }); let msg = amounts.map(move |(from_client, from_server)| { - println!("client at {} wrote {} bytes and received {} bytes", - client_addr, from_client, from_server); + println!("client wrote {} bytes and received {} bytes", + from_client, from_server); }).map_err(|e| { // Don't panic. Maybe the client just disconnected too soon. println!("error: {}", e); |