Rename sender in connect example

This commit is contained in:
Justin Mayhew
2017-02-19 15:02:31 -04:00
parent 1bc2ef6aff
commit c9a8208c8a
+2 -2
View File
@@ -104,7 +104,7 @@ impl Codec for Bytes {
// Our helper method which will read data from stdin and send it along the // Our helper method which will read data from stdin and send it along the
// sender provided. // sender provided.
fn read_stdin(mut rx: mpsc::Sender<Vec<u8>>) { fn read_stdin(mut tx: mpsc::Sender<Vec<u8>>) {
let mut stdin = io::stdin(); let mut stdin = io::stdin();
loop { loop {
let mut buf = vec![0; 1024]; let mut buf = vec![0; 1024];
@@ -114,6 +114,6 @@ fn read_stdin(mut rx: mpsc::Sender<Vec<u8>>) {
Ok(n) => n, Ok(n) => n,
}; };
buf.truncate(n); buf.truncate(n);
rx = rx.send(buf).wait().unwrap(); tx = tx.send(buf).wait().unwrap();
} }
} }