mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-28 00:00:11 +02:00
Merge pull request #175 from mayhewj/rename-sender
Rename sender in connect example
This commit is contained in:
+2
-2
@@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user