diff --git a/tokio-postgres/src/prepare.rs b/tokio-postgres/src/prepare.rs index 851673cad..4ad890274 100644 --- a/tokio-postgres/src/prepare.rs +++ b/tokio-postgres/src/prepare.rs @@ -126,8 +126,7 @@ async fn get_type(client: &Arc, oid: Oid) -> Result { let stmt = typeinfo_statement(client).await?; - let params: &[&dyn ToSql] = &[&oid]; - let buf = query::encode(&stmt, params.iter().cloned()); + let buf = query::encode(&stmt, (&[&oid as &dyn ToSql]).iter().cloned()); let rows = query::query(client.clone(), stmt, buf); pin_mut!(rows); @@ -174,7 +173,7 @@ async fn get_type(client: &Arc, oid: Oid) -> Result { fn get_type_rec<'a>( client: &'a Arc, oid: Oid, -) -> Pin> + 'a>> { +) -> Pin> + Send + 'a>> { Box::pin(get_type(client, oid)) } @@ -198,8 +197,7 @@ async fn typeinfo_statement(client: &Arc) -> Result, oid: Oid) -> Result, Error> { let stmt = typeinfo_enum_statement(client).await?; - let params: &[&dyn ToSql] = &[&oid]; - let buf = query::encode(&stmt, params.iter().cloned()); + let buf = query::encode(&stmt, (&[&oid as &dyn ToSql]).iter().cloned()); query::query(client.clone(), stmt, buf) .and_then(|row| future::ready(row.try_get(0))) .try_collect() @@ -226,8 +224,7 @@ async fn typeinfo_enum_statement(client: &Arc) -> Result, oid: Oid) -> Result, Error> { let stmt = typeinfo_composite_statement(client).await?; - let params: &[&dyn ToSql] = &[&oid]; - let buf = query::encode(&stmt, params.iter().cloned()); + let buf = query::encode(&stmt, (&[&oid as &dyn ToSql]).iter().cloned()); let rows = query::query(client.clone(), stmt, buf) .try_collect::>() .await?;