Skip to content

Commit c516805

Browse files
committed
impl BorrowToSql for:
- Box<dyn ToSql + Sync> - Box<dyn ToSql + Sync + Send>
1 parent c5591c8 commit c516805

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

postgres-types/src/lib.rs

+17
Original file line numberDiff line numberDiff line change
@@ -1044,6 +1044,23 @@ impl BorrowToSql for &dyn ToSql {
10441044
}
10451045
}
10461046

1047+
impl sealed::Sealed for Box<dyn ToSql + Sync> {}
1048+
1049+
impl BorrowToSql for Box<dyn ToSql + Sync> {
1050+
#[inline]
1051+
fn borrow_to_sql(&self) -> &dyn ToSql {
1052+
self.as_ref()
1053+
}
1054+
}
1055+
1056+
impl sealed::Sealed for Box<dyn ToSql + Sync + Send> {}
1057+
impl BorrowToSql for Box<dyn ToSql + Sync + Send> {
1058+
#[inline]
1059+
fn borrow_to_sql(&self) -> &dyn ToSql {
1060+
self.as_ref()
1061+
}
1062+
}
1063+
10471064
impl sealed::Sealed for &(dyn ToSql + Sync) {}
10481065

10491066
/// In async contexts it is sometimes necessary to have the additional

0 commit comments

Comments
 (0)