Revert "Remove superfluous impls"
Turns out ~T won't actually autoborrow to &T when casting to a trait
object. See mozilla/rust#10347
This reverts commit c2a755dd95
.
This commit is contained in:
parent
8e41ccd177
commit
d9a8e261f7
14
types/mod.rs
14
types/mod.rs
@ -436,6 +436,13 @@ to_option_impl!(PgFloat4, f32)
|
||||
to_conversions_impl!(PgFloat8, f64, write_be_f64)
|
||||
to_option_impl!(PgFloat8, f64)
|
||||
|
||||
impl ToSql for ~str {
|
||||
fn to_sql(&self, ty: PostgresType) -> (Format, Option<~[u8]>) {
|
||||
check_types!(PgVarchar | PgText | PgCharN, ty)
|
||||
(Text, Some(self.as_bytes().to_owned()))
|
||||
}
|
||||
}
|
||||
|
||||
impl<'self> ToSql for &'self str {
|
||||
fn to_sql(&self, ty: PostgresType) -> (Format, Option<~[u8]>) {
|
||||
check_types!(PgVarchar | PgText | PgCharN, ty)
|
||||
@ -446,6 +453,13 @@ impl<'self> ToSql for &'self str {
|
||||
to_option_impl!(PgVarchar | PgText | PgCharN, ~str)
|
||||
to_option_impl!(self, PgVarchar | PgText | PgCharN, &'self str)
|
||||
|
||||
impl ToSql for ~[u8] {
|
||||
fn to_sql(&self, ty: PostgresType) -> (Format, Option<~[u8]>) {
|
||||
check_types!(PgByteA, ty)
|
||||
(Binary, Some(self.to_owned()))
|
||||
}
|
||||
}
|
||||
|
||||
impl<'self> ToSql for &'self [u8] {
|
||||
fn to_sql(&self, ty: PostgresType) -> (Format, Option<~[u8]>) {
|
||||
check_types!(PgByteA, ty)
|
||||
|
Loading…
Reference in New Issue
Block a user