Skip to content

Commit c63a7f9

Browse files
committed
DSTify ToSql
1 parent 00164fa commit c63a7f9

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/types/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -488,14 +488,14 @@ impl FromSql for HashMap<String, Option<String>> {
488488
}
489489

490490
/// A trait for types that can be converted into Postgres values
491-
pub trait ToSql {
491+
pub trait ToSql for Sized? {
492492
/// Converts the value of `self` into the binary format appropriate for the
493493
/// Postgres backend.
494494
fn to_sql(&self, ty: &PostgresType) -> PostgresResult<Option<Vec<u8>>>;
495495
}
496496

497497
#[doc(hidden)]
498-
trait RawToSql {
498+
trait RawToSql for Sized? {
499499
fn raw_to_sql<W: Writer>(&self, w: &mut W) -> PostgresResult<()>;
500500
}
501501

@@ -660,7 +660,7 @@ to_raw_to_impl!(PgInt4Range, Range<i32>)
660660
to_raw_to_impl!(PgInt8Range, Range<i64>)
661661
to_raw_to_impl!(PgTsRange | PgTstzRange, Range<Timespec>)
662662

663-
impl<'a> ToSql for &'a str {
663+
impl<'a> ToSql for str {
664664
fn to_sql(&self, ty: &PostgresType) -> PostgresResult<Option<Vec<u8>>> {
665665
check_types!(PgVarchar | PgText | PgCharN | PgName, ty)
666666
Ok(Some(self.as_bytes().to_vec()))
@@ -669,7 +669,7 @@ impl<'a> ToSql for &'a str {
669669

670670
to_option_impl_lifetime!(PgVarchar | PgText | PgCharN | PgName, &'a str)
671671

672-
impl<'a> ToSql for &'a [u8] {
672+
impl<'a> ToSql for [u8] {
673673
fn to_sql(&self, ty: &PostgresType) -> PostgresResult<Option<Vec<u8>>> {
674674
check_types!(PgByteA, ty)
675675
Ok(Some(self.to_vec()))

0 commit comments

Comments
 (0)