From 7064e85e5a854e55d1b4f8f1cd03354d444e50fe Mon Sep 17 00:00:00 2001 From: Ethan Frey Date: Mon, 26 Oct 2020 20:16:39 +0100 Subject: [PATCH] Fix compiler warnings for unneeded mut (#398) --- common/wasm-utils/src/websocket/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/wasm-utils/src/websocket/mod.rs b/common/wasm-utils/src/websocket/mod.rs index 7d11080903..2450186fa7 100644 --- a/common/wasm-utils/src/websocket/mod.rs +++ b/common/wasm-utils/src/websocket/mod.rs @@ -214,7 +214,7 @@ impl Drop for JSWebsocket { impl Stream for JSWebsocket { type Item = Result; - fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { // if there's anything in the internal queue, keep returning that let ws_message = self.message_queue.borrow_mut().pop_front(); match ws_message { @@ -238,7 +238,7 @@ impl Stream for JSWebsocket { impl Sink for JSWebsocket { type Error = WsError; - fn poll_ready(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + fn poll_ready(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { match self.state() { State::Connecting => { // clone the waker to be able to notify the executor once we get connected @@ -280,7 +280,7 @@ impl Sink for JSWebsocket { Poll::Ready(Ok(())) } - fn poll_close(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + fn poll_close(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { match self.state() { State::Open | State::Connecting => { // TODO: do we need to wait for closing event here?