From a379fbbdfbd846a5bcbd0df4cc5deb2b5dd6b709 Mon Sep 17 00:00:00 2001 From: i18n Date: Tue, 18 Feb 2025 18:39:47 +0800 Subject: [PATCH] =?UTF-8?q?impl=20ToStatement=20for=20String=20=E2=86=92?= =?UTF-8?q?=20impl>=20ToStatement=20for=20T?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tokio-postgres/src/to_statement.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tokio-postgres/src/to_statement.rs b/tokio-postgres/src/to_statement.rs index 7e1299272..c1ceda50a 100644 --- a/tokio-postgres/src/to_statement.rs +++ b/tokio-postgres/src/to_statement.rs @@ -1,5 +1,7 @@ -use crate::to_statement::private::{Sealed, ToStatementType}; -use crate::Statement; +use crate::{ + to_statement::private::{Sealed, ToStatementType}, + Statement, +}; mod private { use crate::{Client, Error, Statement}; @@ -47,10 +49,11 @@ impl ToStatement for str { } impl Sealed for str {} +impl Sealed for &str {} -impl ToStatement for String { +impl> ToStatement for T { fn __convert(&self) -> ToStatementType<'_> { - ToStatementType::Query(self) + ToStatementType::Query(self.as_ref()) } }