diff --git a/examples/ping-pong/src/server.rs b/examples/ping-pong/src/server.rs index 8ff229068c..d1e46bc4db 100644 --- a/examples/ping-pong/src/server.rs +++ b/examples/ping-pong/src/server.rs @@ -39,10 +39,10 @@ fn handle_connection(mut stream: TcpStream) -> Result<(), Error> { // right now, the decoder buffer can only read a frame header // because decoder.missing_b is initialized with a header size - let mut decoder_buf = decoder.writable(); + let decoder_buf = decoder.writable(); // read frame header into decoder_buf - stream.read_exact(&mut decoder_buf)?; + stream.read_exact(decoder_buf)?; // this returns an error (MissingBytes), because it only read the header, and there's no payload in memory yet // therefore, we safely ignore the error