From d425ef49f7dd4912d78f9392d65c312dcd0f3881 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Wed, 25 Sep 2024 13:38:03 +0000 Subject: [PATCH] update with_param on Client --- src/lib.rs | 6 +++--- src/query.rs | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index bf0ce12..fda89e1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,7 +5,7 @@ #[macro_use] extern crate static_assertions; -use self::{error::Result, http_client::HttpClient, sql::Bind}; +use self::{error::Result, http_client::HttpClient, sql::ser}; use ::serde::Serialize; use std::{collections::HashMap, fmt::Display, sync::Arc}; @@ -161,9 +161,9 @@ impl Client { self } - pub fn with_param(self, name: &str, value: impl Bind + Serialize) -> Result { + pub fn with_param(self, name: &str, value: impl Serialize) -> Result { let mut param = String::from(""); - Bind::write(&value, &mut param)?; + ser::write_param(&mut param, &value)?; Ok(self.with_option(format!("param_{name}"), param)) } diff --git a/src/query.rs b/src/query.rs index 2c0e196..698d142 100644 --- a/src/query.rs +++ b/src/query.rs @@ -196,9 +196,7 @@ impl Query { self } - pub fn with_param(self, name: &str, value: T) -> Result - where - T: Serialize, + pub fn with_param(self, name: &str, value: impl Serialize) -> Result { let mut param = String::from(""); ser::write_param(&mut param, &value)?;