summaryrefslogtreecommitdiffstats
path: root/examples/chat.rs
diff options
context:
space:
mode:
authoroberien <jaro.fietz@gmx.de>2016-10-14 23:03:46 +0200
committeroberien <jaro.fietz@gmx.de>2016-10-14 23:03:46 +0200
commit7cf7833631eeb664531ed9d8a73b452d02f9bf41 (patch)
treeceb724234144e3a65ac775e033929619e358f865 /examples/chat.rs
parentbc2f857236952ba055aa098c1420b1eb53efeaa2 (diff)
fix(examples): Fix typos in chat example
Rephrase a sentence to not contain the word `join` when we are actually using `select` to prevent confusion.
Diffstat (limited to 'examples/chat.rs')
-rw-r--r--examples/chat.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/chat.rs b/examples/chat.rs
index 530cd090..ca8a5958 100644
--- a/examples/chat.rs
+++ b/examples/chat.rs
@@ -38,8 +38,8 @@ fn main() {
let srv = socket.incoming().for_each(move |(stream, addr)| {
println!("New Connection: {}", addr);
- // Create a channel for for our stream, which other sockets will use to
- // send us message. Then register our address with the stream to send
+ // Create a channel for our stream, which other sockets will use to
+ // send us messages. Then register our address with the stream to send
// data to us.
let (tx, rx) = tokio_core::channel::channel(&handle).unwrap();
connections.borrow_mut().insert(addr, tx);
@@ -85,7 +85,7 @@ fn main() {
let conns = connections.borrow_mut();
if let Ok(msg) = message {
// For each open connection except the sender, send the
- // string via the channel
+ // string via the channel.
let iter = conns.iter()
.filter(|&(&k, _)| k != addr)
.map(|(_, v)| v);
@@ -111,9 +111,9 @@ fn main() {
(socket_reader, socket_writer)
});
- // Now that we've got futures representing each half of the socket, join
- // them together and then spawn off the result. Here we use the `select`
- // combinator to wait for either half to be done to tear down the other.
+ // Now that we've got futures representing each half of the socket, we
+ // use the `select` combinator to wait for either half to be done to
+ // tear down the other. Then we spawn off the result.
let connections = connections.clone();
let addr = addr;
handle.spawn(pair.and_then(|(reader, writer)| {