mirror of
https://github.com/n0-computer/noq.git
synced 2026-09-19 01:36:08 +00:00
Apply clippy suggestions from Rust 1.78
This commit is contained in:
@@ -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()))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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")]
|
||||
{
|
||||
|
||||
@@ -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<()>> {
|
||||
|
||||
Reference in New Issue
Block a user