From 3db330dad2c8cfe92dcc3fa4cb37f3af0691a823 Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Tue, 27 Sep 2022 17:50:17 -0400 Subject: [PATCH] examples: use `write_all` instead of `write` in hello world example (#5044) --- examples/hello_world.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/hello_world.rs b/examples/hello_world.rs index 8ff40902d..ab4e973c0 100644 --- a/examples/hello_world.rs +++ b/examples/hello_world.rs @@ -26,7 +26,7 @@ pub async fn main() -> Result<(), Box> { 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(())