summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorlaizy <laizy@users.noreply.github.com>2018-04-02 11:00:40 -0500
committerCarl Lerche <me@carllerche.com>2018-04-02 09:00:40 -0700
commitd8789cd3791b1e18db61b2cf79ec34ca9a32f609 (patch)
treea4e67556e91a4c0927830015fc7e0c9937e524ef /examples
parent8d4be0361ee39efdb47ba6bf2e4ef6803978b2e9 (diff)
fix panic in chat example (#279)
Diffstat (limited to 'examples')
-rw-r--r--examples/chat.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/chat.rs b/examples/chat.rs
index f325c2d2..a2eb95e1 100644
--- a/examples/chat.rs
+++ b/examples/chat.rs
@@ -216,9 +216,9 @@ impl Future for Peer {
if let Some(message) = line {
// Append the peer's name to the front of the line:
let mut line = self.name.clone();
- line.put(": ");
- line.put(&message);
- line.put("\r\n");
+ line.extend_from_slice(b": ");
+ line.extend_from_slice(&message);
+ line.extend_from_slice(b"\r\n");
// We're using `Bytes`, which allows zero-copy clones (by
// storing the data in an Arc internally).