mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-16 00:00:12 +02:00
examples: fix the write length in the connect-tcp example (#7581)
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
This commit is contained in:
@@ -85,7 +85,7 @@ async fn recv(
|
||||
let n = reader.recv(&mut buf[..]).await?;
|
||||
|
||||
if n > 0 {
|
||||
stdout.send(Bytes::from(buf)).await?;
|
||||
stdout.send(Bytes::copy_from_slice(&buf[..n])).await?;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user