From bdaa39e267be5028cb7a00b156466992f5a3de9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 10 Aug 2022 12:58:28 +0300 Subject: [PATCH] threadshare: Fix some new clippy beta warnings warning: this expression borrows a value the compiler would automatically borrow --> generic/threadshare/src/runtime/executor/async_wrapper.rs:402:19 | 402 | match (&mut *self).get_mut().read(buf) { | ^^^^^^^^^^^^ help: change this to: `(*self)` | = note: `#[warn(clippy::needless_borrow)]` on by default = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow --- .../threadshare/src/runtime/executor/async_wrapper.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/generic/threadshare/src/runtime/executor/async_wrapper.rs b/generic/threadshare/src/runtime/executor/async_wrapper.rs index 434533aa..7da22001 100644 --- a/generic/threadshare/src/runtime/executor/async_wrapper.rs +++ b/generic/threadshare/src/runtime/executor/async_wrapper.rs @@ -399,7 +399,7 @@ impl AsyncRead for Async { buf: &mut [u8], ) -> Poll> { loop { - match (&mut *self).get_mut().read(buf) { + match (*self).get_mut().read(buf) { Err(err) if err.kind() == io::ErrorKind::WouldBlock => {} res => return Poll::Ready(res), } @@ -413,7 +413,7 @@ impl AsyncRead for Async { bufs: &mut [IoSliceMut<'_>], ) -> Poll> { loop { - match (&mut *self).get_mut().read_vectored(bufs) { + match (*self).get_mut().read_vectored(bufs) { Err(err) if err.kind() == io::ErrorKind::WouldBlock => {} res => return Poll::Ready(res), } @@ -462,7 +462,7 @@ impl AsyncWrite for Async { buf: &[u8], ) -> Poll> { loop { - match (&mut *self).get_mut().write(buf) { + match (*self).get_mut().write(buf) { Err(err) if err.kind() == io::ErrorKind::WouldBlock => {} res => return Poll::Ready(res), } @@ -476,7 +476,7 @@ impl AsyncWrite for Async { bufs: &[IoSlice<'_>], ) -> Poll> { loop { - match (&mut *self).get_mut().write_vectored(bufs) { + match (*self).get_mut().write_vectored(bufs) { Err(err) if err.kind() == io::ErrorKind::WouldBlock => {} res => return Poll::Ready(res), } @@ -486,7 +486,7 @@ impl AsyncWrite for Async { fn poll_flush(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { loop { - match (&mut *self).get_mut().flush() { + match (*self).get_mut().flush() { Err(err) if err.kind() == io::ErrorKind::WouldBlock => {} res => return Poll::Ready(res), }