examples: use write_all instead of write in hello world example (#5044)

This commit is contained in:
Carl Dong 2022-09-27 17:50:17 -04:00 committed by GitHub
parent feef48fb58
commit 3db330dad2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,7 +26,7 @@ pub async fn main() -> Result<(), Box<dyn Error>> {
let mut stream = TcpStream::connect("127.0.0.1:6142").await?;
println!("created stream");
let result = stream.write(b"hello world\n").await;
let result = stream.write_all(b"hello world\n").await;
println!("wrote to stream; success={:?}", result.is_ok());
Ok(())