diff options
author | Taiki Endo <te316e89@gmail.com> | 2019-07-26 03:47:14 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-26 03:47:14 +0900 |
commit | fe021e6c008a886c1c6ad97c9f5f0c667fad34c6 (patch) | |
tree | 826239d95e6f7b6511a01ab93ecdcebb9aeab06e /tokio-tls | |
parent | f311ac3d4faa4fa1203ad5586a7676604ffe7736 (diff) |
ci: enable clippy lints (#1335)
Diffstat (limited to 'tokio-tls')
-rw-r--r-- | tokio-tls/src/lib.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tokio-tls/src/lib.rs b/tokio-tls/src/lib.rs index f2730e28..b16f0473 100644 --- a/tokio-tls/src/lib.rs +++ b/tokio-tls/src/lib.rs @@ -149,8 +149,7 @@ impl<S> TlsStream<S> { { self.0.get_mut().context = ctx as *mut _ as *mut (); let g = Guard(self); - let r = f(&mut (g.0).0); - r + f(&mut (g.0).0) } } @@ -193,8 +192,8 @@ where fn poll_shutdown(mut self: Pin<&mut Self>, ctx: &mut Context<'_>) -> Poll<io::Result<()>> { match self.with_context(ctx, |s| s.shutdown()) { Ok(()) => Poll::Ready(Ok(())), - Err(ref e) if e.kind() == io::ErrorKind::WouldBlock => return Poll::Pending, - Err(e) => return Poll::Ready(Err(e)), + Err(ref e) if e.kind() == io::ErrorKind::WouldBlock => Poll::Pending, + Err(e) => Poll::Ready(Err(e)), } } } @@ -289,6 +288,7 @@ impl TlsAcceptor { /// This is typically used after a new socket has been accepted from a /// `TcpListener`. That socket is then passed to this function to perform /// the server half of accepting a client connection. + #[allow(clippy::needless_lifetimes)] // false positive: https://github.com/rust-lang/rust-clippy/issues/3988 pub async fn accept<S>(&self, stream: S) -> Result<TlsStream<S>, Error> where S: AsyncRead + AsyncWrite + Unpin, |