Skip to content

Commit 13af5f3

Browse files
committed
impl IntoArguments for Arguments
1 parent 91d26ba commit 13af5f3

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

sqlx-core/src/arguments.rs

+20-10
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,29 @@ pub trait IntoArguments<'q, DB: Database>: Sized + Send {
3737
#[macro_export]
3838
macro_rules! impl_into_arguments_for_arguments {
3939
($Arguments:path) => {
40-
impl<'q>
41-
$crate::arguments::IntoArguments<
42-
'q,
43-
<$Arguments as $crate::arguments::Arguments<'q>>::Database,
44-
> for $Arguments
45-
{
46-
fn into_arguments(self) -> $Arguments {
47-
self
48-
}
49-
}
40+
// impl<'q>
41+
// $crate::arguments::IntoArguments<
42+
// 'q,
43+
// <$Arguments as $crate::arguments::Arguments<'q>>::Database,
44+
// > for $Arguments
45+
// {
46+
// fn into_arguments(self) -> $Arguments {
47+
// self
48+
// }
49+
// }
5050
};
5151
}
5252

53+
impl <'q, DB, T> IntoArguments<'q, DB> for T
54+
where
55+
DB:Database,
56+
T: Arguments<'q, Database = DB> + Into<<DB as Database>::Arguments<'q>>,
57+
{
58+
fn into_arguments(self) -> <DB as Database>::Arguments<'q> {
59+
self.into()
60+
}
61+
}
62+
5363
/// used by the query macros to prevent supernumerary `.bind()` calls
5464
pub struct ImmutableArguments<'q, DB: Database>(pub <DB as Database>::Arguments<'q>);
5565

0 commit comments

Comments
 (0)