summaryrefslogtreecommitdiffstats
path: root/examples/chat.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/chat.rs')
-rw-r--r--examples/chat.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/examples/chat.rs b/examples/chat.rs
index fac43cbf..b3fb727a 100644
--- a/examples/chat.rs
+++ b/examples/chat.rs
@@ -193,9 +193,7 @@ async fn process(
let mut lines = Framed::new(stream, LinesCodec::new());
// Send a prompt to the client to enter their username.
- lines
- .send(String::from("Please enter your username:"))
- .await?;
+ lines.send("Please enter your username:").await?;
// Read the first line from the `LineCodec` stream to get the username.
let username = match lines.next().await {
@@ -232,7 +230,7 @@ async fn process(
// A message was received from a peer. Send it to the
// current user.
Ok(Message::Received(msg)) => {
- peer.lines.send(msg).await?;
+ peer.lines.send(&msg).await?;
}
Err(e) => {
println!(