Skip to content

Commit 996f063

Browse files
committed
map to convert to &dyn ToSql is not longer necessary
1 parent 42dcfb5 commit 996f063

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

postgres/src/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ impl Client {
253253
/// ];
254254
/// let mut it = client.query_raw(
255255
/// "SELECT foo FROM bar WHERE biz = $1 AND baz = $2",
256-
/// params.iter().map(|p| p as &dyn ToSql),
256+
/// params,
257257
/// )?;
258258
///
259259
/// while let Some(row) = it.next()? {

tokio-postgres/src/client.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,6 @@ impl Client {
318318
///
319319
/// # Examples
320320
///
321-
/// If you have a type like `Vec<T>` where `T: ToSql` Rust will not know how to use it as params. To get around
322-
/// this the type must explicitly be converted to `&dyn ToSql`.
323-
///
324321
/// ```no_run
325322
/// # async fn async_main(client: &tokio_postgres::Client) -> Result<(), tokio_postgres::Error> {
326323
/// use tokio_postgres::types::ToSql;
@@ -332,7 +329,7 @@ impl Client {
332329
/// ];
333330
/// let mut it = client.query_raw(
334331
/// "SELECT foo FROM bar WHERE biz = $1 AND baz = $2",
335-
/// params.iter().map(|p| p as &dyn ToSql),
332+
/// params,
336333
/// ).await?;
337334
///
338335
/// pin_mut!(it);

0 commit comments

Comments
 (0)