Skip to content

Commit

Permalink
update with_param on Client
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex committed Sep 25, 2024
1 parent 0ef9c77 commit d425ef4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down Expand Up @@ -161,9 +161,9 @@ impl Client {
self
}

pub fn with_param(self, name: &str, value: impl Bind + Serialize) -> Result<Self, String> {
pub fn with_param(self, name: &str, value: impl Serialize) -> Result<Self, String> {
let mut param = String::from("");
Bind::write(&value, &mut param)?;
ser::write_param(&mut param, &value)?;
Ok(self.with_option(format!("param_{name}"), param))
}

Expand Down
4 changes: 1 addition & 3 deletions src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,7 @@ impl Query {
self
}

pub fn with_param<T>(self, name: &str, value: T) -> Result<Self, String>
where
T: Serialize,
pub fn with_param(self, name: &str, value: impl Serialize) -> Result<Self, String>
{
let mut param = String::from("");
ser::write_param(&mut param, &value)?;
Expand Down

0 comments on commit d425ef4

Please sign in to comment.