mirror of
https://github.com/isar/rusqlite.git
synced 2025-10-31 05:48:56 +08:00
impl ToSql for Box<dyn ToSql>. Fixes #500
This commit is contained in:
@@ -84,6 +84,13 @@ pub trait ToSql {
|
||||
fn to_sql(&self) -> Result<ToSqlOutput<'_>>;
|
||||
}
|
||||
|
||||
impl ToSql for Box<dyn ToSql> {
|
||||
fn to_sql(&self) -> Result<ToSqlOutput<'_>> {
|
||||
let derefed: &dyn ToSql = &**self;
|
||||
derefed.to_sql()
|
||||
}
|
||||
}
|
||||
|
||||
// We should be able to use a generic impl like this:
|
||||
//
|
||||
// impl<T: Copy> ToSql for T where T: Into<Value> {
|
||||
|
||||
Reference in New Issue
Block a user