Skip to content

Commit

Permalink
examples: use write_all instead of write in hello world example (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
dongcarl committed Sep 27, 2022
1 parent feef48f commit 3db330d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/hello_world.rs
Expand Up @@ -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(())
Expand Down

0 comments on commit 3db330d

Please sign in to comment.