diff --git a/tokio-postgres/src/client.rs b/tokio-postgres/src/client.rs index 8c9e133d..68ccaf37 100644 --- a/tokio-postgres/src/client.rs +++ b/tokio-postgres/src/client.rs @@ -384,10 +384,7 @@ impl Client { /// # Panics /// /// Panics if the statement contains parameters. - pub async fn copy_in( - &self, - statement: &T, - ) -> Result, Error> + pub async fn copy_in(&self, statement: &T) -> Result, Error> where T: ?Sized + ToStatement, U: Buf + 'static + Send, @@ -403,10 +400,7 @@ impl Client { /// # Panics /// /// Panics if the statement contains parameters. - pub async fn copy_out( - &self, - statement: &T, - ) -> Result + pub async fn copy_out(&self, statement: &T) -> Result where T: ?Sized + ToStatement, { diff --git a/tokio-postgres/src/copy_in.rs b/tokio-postgres/src/copy_in.rs index cfaa32bd..f9b8f599 100644 --- a/tokio-postgres/src/copy_in.rs +++ b/tokio-postgres/src/copy_in.rs @@ -1,7 +1,7 @@ use crate::client::{InnerClient, Responses}; use crate::codec::FrontendMessage; use crate::connection::RequestMessages; -use crate::{query, Error, Statement, slice_iter}; +use crate::{query, slice_iter, Error, Statement}; use bytes::buf::BufExt; use bytes::{Buf, BufMut, BytesMut}; use futures::channel::mpsc; @@ -195,10 +195,7 @@ where } } -pub async fn copy_in( - client: &InnerClient, - statement: Statement, -) -> Result, Error> +pub async fn copy_in(client: &InnerClient, statement: Statement) -> Result, Error> where T: Buf + 'static + Send, { diff --git a/tokio-postgres/src/copy_out.rs b/tokio-postgres/src/copy_out.rs index eb9cfb4d..62c1a1a4 100644 --- a/tokio-postgres/src/copy_out.rs +++ b/tokio-postgres/src/copy_out.rs @@ -1,7 +1,7 @@ use crate::client::{InnerClient, Responses}; use crate::codec::FrontendMessage; use crate::connection::RequestMessages; -use crate::{query, Error, Statement, slice_iter}; +use crate::{query, slice_iter, Error, Statement}; use bytes::Bytes; use futures::{ready, Stream}; use pin_project_lite::pin_project; @@ -10,10 +10,7 @@ use std::marker::PhantomPinned; use std::pin::Pin; use std::task::{Context, Poll}; -pub async fn copy_out( - client: &InnerClient, - statement: Statement, -) -> Result { +pub async fn copy_out(client: &InnerClient, statement: Statement) -> Result { let buf = query::encode(client, &statement, slice_iter(&[]))?; let responses = start(client, buf).await?; Ok(CopyOutStream { diff --git a/tokio-postgres/src/transaction.rs b/tokio-postgres/src/transaction.rs index 4702b917..aaf7efd8 100644 --- a/tokio-postgres/src/transaction.rs +++ b/tokio-postgres/src/transaction.rs @@ -221,10 +221,7 @@ impl<'a> Transaction<'a> { } /// Like `Client::copy_in`. - pub async fn copy_in( - &self, - statement: &T, - ) -> Result, Error> + pub async fn copy_in(&self, statement: &T) -> Result, Error> where T: ?Sized + ToStatement, U: Buf + 'static + Send, @@ -233,10 +230,7 @@ impl<'a> Transaction<'a> { } /// Like `Client::copy_out`. - pub async fn copy_out( - &self, - statement: &T, - ) -> Result + pub async fn copy_out(&self, statement: &T) -> Result where T: ?Sized + ToStatement, {