From 482f3c3aa6f7c981a6c76f6903c0d7ca3cd416e3 Mon Sep 17 00:00:00 2001 From: quininer Date: Fri, 17 Aug 2018 13:07:26 +0800 Subject: [PATCH] impl prepare_uninitialized_buffer --- src/common/vecbuf.rs | 2 +- src/tokio_impl.rs | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/common/vecbuf.rs b/src/common/vecbuf.rs index dd40163..81bec86 100644 --- a/src/common/vecbuf.rs +++ b/src/common/vecbuf.rs @@ -48,7 +48,7 @@ impl<'a, 'b> Buf for VecBuf<'a, 'b> { } } - #[allow(needless_range_loop)] + #[cfg_attr(feature = "cargo-clippy", allow(needless_range_loop))] fn bytes_vec<'c>(&'c self, dst: &mut [&'c IoVec]) -> usize { let len = cmp::min(self.inner.len() - self.pos, dst.len()); diff --git a/src/tokio_impl.rs b/src/tokio_impl.rs index 9f09705..e3fd4d5 100644 --- a/src/tokio_impl.rs +++ b/src/tokio_impl.rs @@ -52,7 +52,11 @@ impl AsyncRead for TlsStream where S: AsyncRead + AsyncWrite, C: Session -{} +{ + unsafe fn prepare_uninitialized_buffer(&self, _: &mut [u8]) -> bool { + false + } +} impl AsyncWrite for TlsStream where