From de3f63737bb841cd8a56280e1f5eaeada87dc9fb Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Thu, 2 May 2024 21:38:07 +0200 Subject: [PATCH] Apply clippy suggestions from Rust 1.78 --- quinn/src/recv_stream.rs | 2 +- quinn/src/runtime.rs | 1 + quinn/src/send_stream.rs | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/quinn/src/recv_stream.rs b/quinn/src/recv_stream.rs index 7d491bf5e..bd9ff84b7 100644 --- a/quinn/src/recv_stream.rs +++ b/quinn/src/recv_stream.rs @@ -476,7 +476,7 @@ impl futures_io::AsyncRead for RecvStream { buf: &mut [u8], ) -> Poll> { let mut buf = ReadBuf::new(buf); - ready!(RecvStream::poll_read_buf(self.get_mut(), cx, &mut buf))?; + ready!(Self::poll_read_buf(self.get_mut(), cx, &mut buf))?; Poll::Ready(Ok(buf.filled().len())) } } diff --git a/quinn/src/runtime.rs b/quinn/src/runtime.rs index 2a7a9c59f..ad1afdc9e 100644 --- a/quinn/src/runtime.rs +++ b/quinn/src/runtime.rs @@ -157,6 +157,7 @@ impl Debug for UdpPollHelper { /// then `TokioRuntime` is returned. Otherwise, if `runtime-async-std` is enabled, `AsyncStdRuntime` /// is returned. Otherwise, if `runtime-smol` is enabled, `SmolRuntime` is returned. /// Otherwise, `None` is returned. +#[allow(clippy::needless_return)] // Be sure we return the right thing pub fn default_runtime() -> Option> { #[cfg(feature = "runtime-tokio")] { diff --git a/quinn/src/send_stream.rs b/quinn/src/send_stream.rs index 0c2581936..b953678c0 100644 --- a/quinn/src/send_stream.rs +++ b/quinn/src/send_stream.rs @@ -265,7 +265,7 @@ impl SendStream { #[cfg(feature = "futures-io")] impl futures_io::AsyncWrite for SendStream { fn poll_write(self: Pin<&mut Self>, cx: &mut Context, buf: &[u8]) -> Poll> { - SendStream::execute_poll(self.get_mut(), cx, |stream| stream.write(buf)).map_err(Into::into) + Self::execute_poll(self.get_mut(), cx, |stream| stream.write(buf)).map_err(Into::into) } fn poll_flush(self: Pin<&mut Self>, _cx: &mut Context) -> Poll> {