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..f18a60d 100644 --- a/src/query.rs +++ b/src/query.rs @@ -196,10 +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)?; Ok(self.with_option(format!("param_{name}"), param))