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

This commit is contained in:
Carl Dong
2022-09-27 21:50:17 +00:00
committed by GitHub
parent feef48fb58
commit 3db330dad2
+1 -1
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(())