From bb22802bfc3733ba2040de6ec0cfb8d3fd186fac Mon Sep 17 00:00:00 2001 From: David Pedersen Date: Sun, 16 Jul 2023 13:49:53 +0200 Subject: [PATCH] Update to latest sqlx in example (#2099) --- examples/sqlx-postgres/Cargo.toml | 2 +- examples/sqlx-postgres/src/main.rs | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/sqlx-postgres/Cargo.toml b/examples/sqlx-postgres/Cargo.toml index 48a976c32d..3bc40302ed 100644 --- a/examples/sqlx-postgres/Cargo.toml +++ b/examples/sqlx-postgres/Cargo.toml @@ -10,4 +10,4 @@ tokio = { version = "1.0", features = ["full"] } tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } -sqlx = { version = "0.6.3", features = ["runtime-tokio-rustls", "any", "postgres"] } +sqlx = { version = "0.7", features = ["runtime-tokio-rustls", "any", "postgres"] } diff --git a/examples/sqlx-postgres/src/main.rs b/examples/sqlx-postgres/src/main.rs index d9317bc86e..8660b387a7 100644 --- a/examples/sqlx-postgres/src/main.rs +++ b/examples/sqlx-postgres/src/main.rs @@ -93,11 +93,10 @@ where } async fn using_connection_extractor( - DatabaseConnection(conn): DatabaseConnection, + DatabaseConnection(mut conn): DatabaseConnection, ) -> Result { - let mut conn = conn; sqlx::query_scalar("select 'hello world from pg'") - .fetch_one(&mut conn) + .fetch_one(&mut *conn) .await .map_err(internal_error) }