fix clippy
This commit is contained in:
parent
681cbe68ca
commit
163a96b062
@ -52,20 +52,17 @@ where IO: AsyncRead + AsyncWrite,
|
|||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn poll(&mut self) -> Poll<Self::Item, Self::Error> {
|
fn poll(&mut self) -> Poll<Self::Item, Self::Error> {
|
||||||
match self {
|
if let MidHandshake::Handshaking(stream) = self {
|
||||||
MidHandshake::Handshaking(stream) => {
|
let (io, session) = stream.get_mut();
|
||||||
let (io, session) = stream.get_mut();
|
let mut stream = Stream::new(io, session);
|
||||||
let mut stream = Stream::new(io, session);
|
|
||||||
|
|
||||||
if stream.session.is_handshaking() {
|
if stream.session.is_handshaking() {
|
||||||
try_nb!(stream.complete_io());
|
try_nb!(stream.complete_io());
|
||||||
}
|
}
|
||||||
|
|
||||||
if stream.session.wants_write() {
|
if stream.session.wants_write() {
|
||||||
try_nb!(stream.complete_io());
|
try_nb!(stream.complete_io());
|
||||||
}
|
}
|
||||||
},
|
|
||||||
_ => ()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
match mem::replace(self, MidHandshake::End) {
|
match mem::replace(self, MidHandshake::End) {
|
||||||
|
@ -84,8 +84,8 @@ impl<'a, IO: AsyncRead + AsyncWrite, S: Session> WriteTls<'a, IO, S> for Stream<
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut vecbuf = V(self.io);
|
let mut vecio = V(self.io);
|
||||||
self.session.writev_tls(&mut vecbuf)
|
self.session.writev_tls(&mut vecio)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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 {
|
fn bytes_vec<'c>(&'c self, dst: &mut [&'c IoVec]) -> usize {
|
||||||
let len = cmp::min(self.inner.len() - self.pos, dst.len());
|
let len = cmp::min(self.inner.len() - self.pos, dst.len());
|
||||||
|
|
||||||
|
@ -48,20 +48,17 @@ where IO: AsyncRead + AsyncWrite,
|
|||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn poll(&mut self) -> Poll<Self::Item, Self::Error> {
|
fn poll(&mut self) -> Poll<Self::Item, Self::Error> {
|
||||||
match self {
|
if let MidHandshake::Handshaking(stream) = self {
|
||||||
MidHandshake::Handshaking(stream) => {
|
let (io, session) = stream.get_mut();
|
||||||
let (io, session) = stream.get_mut();
|
let mut stream = Stream::new(io, session);
|
||||||
let mut stream = Stream::new(io, session);
|
|
||||||
|
|
||||||
if stream.session.is_handshaking() {
|
if stream.session.is_handshaking() {
|
||||||
try_nb!(stream.complete_io());
|
try_nb!(stream.complete_io());
|
||||||
}
|
}
|
||||||
|
|
||||||
if stream.session.wants_write() {
|
if stream.session.wants_write() {
|
||||||
try_nb!(stream.complete_io());
|
try_nb!(stream.complete_io());
|
||||||
}
|
}
|
||||||
},
|
|
||||||
_ => ()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
match mem::replace(self, MidHandshake::End) {
|
match mem::replace(self, MidHandshake::End) {
|
||||||
|
Loading…
Reference in New Issue
Block a user