summaryrefslogtreecommitdiffstats
path: root/examples/chat.rs
diff options
context:
space:
mode:
authorCarl Lerche <me@carllerche.com>2018-01-30 13:01:34 -0800
committerAlex Crichton <alex@alexcrichton.com>2018-01-30 15:01:34 -0600
commitae627db266600f8d010b6eeb9d1be0fff677f0ce (patch)
treee9c020593a2e63a20ba39a5c426e42e69a8920fd /examples/chat.rs
parentf4ec9a6360c5e2d3066dc5b278f116c8febe701c (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/chat.rs')
-rw-r--r--examples/chat.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/chat.rs b/examples/chat.rs
index d141f62b..76e689b9 100644
--- a/examples/chat.rs
+++ b/examples/chat.rs
@@ -49,7 +49,9 @@ fn main() {
// Once the same thread executor lands, transition to single threaded.
let connections = Arc::new(Mutex::new(HashMap::new()));
- let srv = socket.incoming().for_each(move |(stream, addr)| {
+ let srv = socket.incoming().for_each(move |stream| {
+ let addr = stream.peer_addr().unwrap();
+
println!("New Connection: {}", addr);
let (reader, writer) = stream.split();