diff --git a/postgres-protocol/src/authentication/sasl.rs b/postgres-protocol/src/authentication/sasl.rs index ccd40e8d0..85a589c99 100644 --- a/postgres-protocol/src/authentication/sasl.rs +++ b/postgres-protocol/src/authentication/sasl.rs @@ -180,7 +180,7 @@ impl ScramSha256 { password, channel_binding, } => (nonce, password, channel_binding), - _ => return Err(io::Error::new(io::ErrorKind::Other, "invalid SCRAM state")), + _ => return Err(io::Error::other("invalid SCRAM state")), }; let message = @@ -252,7 +252,7 @@ impl ScramSha256 { salted_password, auth_message, } => (salted_password, auth_message), - _ => return Err(io::Error::new(io::ErrorKind::Other, "invalid SCRAM state")), + _ => return Err(io::Error::other("invalid SCRAM state")), }; let message = @@ -262,10 +262,7 @@ impl ScramSha256 { let verifier = match parsed { ServerFinalMessage::Error(e) => { - return Err(io::Error::new( - io::ErrorKind::Other, - format!("SCRAM error: {}", e), - )); + return Err(io::Error::other(format!("SCRAM error: {}", e))); } ServerFinalMessage::Verifier(verifier) => verifier, }; diff --git a/postgres-protocol/src/types/mod.rs b/postgres-protocol/src/types/mod.rs index 37dc793b1..03bd90799 100644 --- a/postgres-protocol/src/types/mod.rs +++ b/postgres-protocol/src/types/mod.rs @@ -324,7 +324,7 @@ pub fn varbit_from_sql(mut buf: &[u8]) -> Result, StdBox { } fn flush(&mut self) -> io::Result<()> { - self.flush_inner() - .map_err(|e| io::Error::new(io::ErrorKind::Other, e)) + self.flush_inner().map_err(io::Error::other) } } diff --git a/postgres/src/copy_out_reader.rs b/postgres/src/copy_out_reader.rs index 828b71873..b683ddeec 100644 --- a/postgres/src/copy_out_reader.rs +++ b/postgres/src/copy_out_reader.rs @@ -41,7 +41,7 @@ impl BufRead for CopyOutReader<'_> { .block_on(async { stream.next().await.transpose() }) { Ok(Some(cur)) => self.cur = cur, - Err(e) => return Err(io::Error::new(io::ErrorKind::Other, e)), + Err(e) => return Err(io::Error::other(e)), Ok(None) => break, }; } diff --git a/tokio-postgres/src/config.rs b/tokio-postgres/src/config.rs index 7ba5638e3..59edd8fe2 100644 --- a/tokio-postgres/src/config.rs +++ b/tokio-postgres/src/config.rs @@ -1,5 +1,7 @@ //! Connection configuration. +#![allow(clippy::doc_overindented_list_items)] + #[cfg(feature = "runtime")] use crate::connect::connect; use crate::connect_raw::connect_raw;