From c7055dc66506d4a696c16063ceb8ffe5decff0ee Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Wed, 9 Oct 2019 15:20:23 -0700 Subject: [PATCH] Clippy fixes --- codegen/src/type_gen.rs | 5 ++--- postgres-native-tls/src/lib.rs | 1 + postgres-openssl/src/lib.rs | 1 + tokio-postgres/src/query.rs | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/codegen/src/type_gen.rs b/codegen/src/type_gen.rs index 1e882ab1..1b3379ab 100644 --- a/codegen/src/type_gen.rs +++ b/codegen/src/type_gen.rs @@ -144,9 +144,8 @@ impl<'a> DatParser<'a> { fn eof(&mut self) { self.skip_ws(); - match self.it.next() { - Some((_, ch)) => panic!("expected eof but got {}", ch), - None => {} + if let Some((_, ch)) = self.it.next() { + panic!("expected eof but got {}", ch); } } diff --git a/postgres-native-tls/src/lib.rs b/postgres-native-tls/src/lib.rs index a79fbebd..b231586a 100644 --- a/postgres-native-tls/src/lib.rs +++ b/postgres-native-tls/src/lib.rs @@ -110,6 +110,7 @@ where { type Stream = TlsStream; type Error = native_tls::Error; + #[allow(clippy::type_complexity)] type Future = Pin< Box, ChannelBinding), native_tls::Error>> + Send>, >; diff --git a/postgres-openssl/src/lib.rs b/postgres-openssl/src/lib.rs index 78f4620e..ff7c3d7a 100644 --- a/postgres-openssl/src/lib.rs +++ b/postgres-openssl/src/lib.rs @@ -132,6 +132,7 @@ where { type Stream = SslStream; type Error = HandshakeError; + #[allow(clippy::type_complexity)] type Future = Pin< Box, ChannelBinding), HandshakeError>> + Send>, >; diff --git a/tokio-postgres/src/query.rs b/tokio-postgres/src/query.rs index 57af33f6..5686ab9f 100644 --- a/tokio-postgres/src/query.rs +++ b/tokio-postgres/src/query.rs @@ -133,8 +133,8 @@ where ); match r { Ok(()) => Ok(buf), - Err(frontend::BindError::Conversion(e)) => return Err(Error::to_sql(e, error_idx)), - Err(frontend::BindError::Serialization(e)) => return Err(Error::encode(e)), + Err(frontend::BindError::Conversion(e)) => Err(Error::to_sql(e, error_idx)), + Err(frontend::BindError::Serialization(e)) => Err(Error::encode(e)), } }