mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-28 00:00:11 +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?;
|
let n = reader.recv(&mut buf[..]).await?;
|
||||||
|
|
||||||
if n > 0 {
|
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