diff --git a/examples/websocket-chat/src/main.rs b/examples/websocket-chat/src/main.rs index 9c9af18e5..0252f141e 100644 --- a/examples/websocket-chat/src/main.rs +++ b/examples/websocket-chat/src/main.rs @@ -87,7 +87,7 @@ impl Handler for WsChatSession { type Result = (); fn handle(&mut self, msg: session::Message, ctx: &mut Self::Context) { - ctx.text(&msg.0); + ctx.text(msg.0); } } @@ -113,7 +113,7 @@ impl Handler for WsChatSession { match res { Ok(Ok(rooms)) => { for room in rooms { - ctx.text(&room); + ctx.text(room); } }, _ => println!("Something is wrong"), @@ -142,7 +142,7 @@ impl Handler for WsChatSession { ctx.text("!!! name is required"); } }, - _ => ctx.text(&format!("!!! unknown command: {:?}", m)), + _ => ctx.text(format!("!!! unknown command: {:?}", m)), } } else { let msg = if let Some(ref name) = self.name { diff --git a/examples/websocket/src/main.rs b/examples/websocket/src/main.rs index 1319a88d8..9149ead71 100644 --- a/examples/websocket/src/main.rs +++ b/examples/websocket/src/main.rs @@ -33,7 +33,7 @@ impl Handler for MyWebSocket { println!("WS: {:?}", msg); match msg { ws::Message::Ping(msg) => ctx.pong(&msg), - ws::Message::Text(text) => ctx.text(&text), + ws::Message::Text(text) => ctx.text(text), ws::Message::Binary(bin) => ctx.binary(bin), ws::Message::Closed | ws::Message::Error => { ctx.stop(); diff --git a/guide/src/qs_9.md b/guide/src/qs_9.md index 32fe7d3b6..dbca38384 100644 --- a/guide/src/qs_9.md +++ b/guide/src/qs_9.md @@ -28,7 +28,7 @@ impl Handler for Ws { fn handle(&mut self, msg: ws::Message, ctx: &mut Self::Context) { match msg { ws::Message::Ping(msg) => ctx.pong(&msg), - ws::Message::Text(text) => ctx.text(&text), + ws::Message::Text(text) => ctx.text(text), ws::Message::Binary(bin) => ctx.binary(bin), _ => (), }