Apply clippy suggestions from Rust 1.78

This commit is contained in:
Dirkjan Ochtman
2024-05-02 21:38:07 +02:00
parent 5b722706b3
commit de3f63737b
3 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -476,7 +476,7 @@ impl futures_io::AsyncRead for RecvStream {
buf: &mut [u8],
) -> Poll<io::Result<usize>> {
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()))
}
}
+1
View File
@@ -157,6 +157,7 @@ impl<MakeFut, Fut> Debug for UdpPollHelper<MakeFut, Fut> {
/// 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<Arc<dyn Runtime>> {
#[cfg(feature = "runtime-tokio")]
{
+1 -1
View File
@@ -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<io::Result<usize>> {
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<io::Result<()>> {