fix clippy

This commit is contained in:
quininer 2019-02-23 01:48:09 +08:00
parent 681cbe68ca
commit 163a96b062
4 changed files with 21 additions and 27 deletions

View File

@ -52,8 +52,7 @@ where IO: AsyncRead + AsyncWrite,
#[inline]
fn poll(&mut self) -> Poll<Self::Item, Self::Error> {
match self {
MidHandshake::Handshaking(stream) => {
if let MidHandshake::Handshaking(stream) = self {
let (io, session) = stream.get_mut();
let mut stream = Stream::new(io, session);
@ -64,8 +63,6 @@ where IO: AsyncRead + AsyncWrite,
if stream.session.wants_write() {
try_nb!(stream.complete_io());
}
},
_ => ()
}
match mem::replace(self, MidHandshake::End) {

View File

@ -84,8 +84,8 @@ impl<'a, IO: AsyncRead + AsyncWrite, S: Session> WriteTls<'a, IO, S> for Stream<
}
}
let mut vecbuf = V(self.io);
self.session.writev_tls(&mut vecbuf)
let mut vecio = V(self.io);
self.session.writev_tls(&mut vecio)
}
}

View File

@ -48,7 +48,7 @@ impl<'a, 'b> Buf for VecBuf<'a, 'b> {
}
}
#[cfg_attr(feature = "cargo-clippy", allow(needless_range_loop))]
#[allow(clippy::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());

View File

@ -48,8 +48,7 @@ where IO: AsyncRead + AsyncWrite,
#[inline]
fn poll(&mut self) -> Poll<Self::Item, Self::Error> {
match self {
MidHandshake::Handshaking(stream) => {
if let MidHandshake::Handshaking(stream) = self {
let (io, session) = stream.get_mut();
let mut stream = Stream::new(io, session);
@ -60,8 +59,6 @@ where IO: AsyncRead + AsyncWrite,
if stream.session.wants_write() {
try_nb!(stream.complete_io());
}
},
_ => ()
}
match mem::replace(self, MidHandshake::End) {