@@ -155,7 +155,6 @@ pub use pg_lsn::PgLsn;
155
155
156
156
pub use crate :: special:: { Date , Timestamp } ;
157
157
use bytes:: BytesMut ;
158
- use smol_str:: SmolStr ;
159
158
160
159
// Number of seconds from 1970-01-01 to 2000-01-01
161
160
const TIME_SEC_CONVERSION : u64 = 946_684_800 ;
@@ -233,6 +232,8 @@ mod time_03;
233
232
mod uuid_08;
234
233
#[ cfg( feature = "with-uuid-1" ) ]
235
234
mod uuid_1;
235
+ #[ cfg( feature = "smol_str-01" ) ]
236
+ mod smol_str_01;
236
237
237
238
// The time::{date, time} macros produce compile errors if the crate package is renamed.
238
239
#[ cfg( feature = "with-time-0_2" ) ]
@@ -444,6 +445,9 @@ impl WrongType {
444
445
/// | `eui48::MacAddress` | MACADDR |
445
446
/// | `cidr::InetCidr` | CIDR |
446
447
/// | `cidr::InetAddr` | INET |
448
+ /// | `smol_str::SmolStr` | VARCHAR, CHAR(n), TEXT, CITEXT, |
449
+ /// | | NAME, UNKNOWN, LTREE, LQUERY, |
450
+ /// | | LTXTQUERY |
447
451
///
448
452
/// # Nullability
449
453
///
@@ -630,18 +634,6 @@ impl<'a> FromSql<'a> for Box<str> {
630
634
}
631
635
}
632
636
633
- #[ cfg( feature = "smol_str" ) ]
634
- impl < ' a > FromSql < ' a > for smol_str:: SmolStr {
635
- fn from_sql ( ty : & Type , raw : & ' a [ u8 ] ) -> Result < SmolStr , Box < dyn Error + Sync + Send > > {
636
- <& str as FromSql >:: from_sql ( ty, raw)
637
- . map ( SmolStr :: from)
638
- }
639
-
640
- fn accepts ( ty : & Type ) -> bool {
641
- <& str as FromSql >:: accepts ( ty)
642
- }
643
- }
644
-
645
637
impl < ' a > FromSql < ' a > for & ' a str {
646
638
fn from_sql ( ty : & Type , raw : & ' a [ u8 ] ) -> Result < & ' a str , Box < dyn Error + Sync + Send > > {
647
639
match * ty {
@@ -1042,19 +1034,6 @@ impl ToSql for Box<str> {
1042
1034
to_sql_checked ! ( ) ;
1043
1035
}
1044
1036
1045
- #[ cfg( feature = "smol_str" ) ]
1046
- impl ToSql for smol_str:: SmolStr {
1047
- fn to_sql ( & self , ty : & Type , w : & mut BytesMut ) -> Result < IsNull , Box < dyn Error + Sync + Send > > {
1048
- <& str as ToSql >:: to_sql ( & & * * self , ty, w)
1049
- }
1050
-
1051
- fn accepts ( ty : & Type ) -> bool {
1052
- <& str as ToSql >:: accepts ( ty)
1053
- }
1054
-
1055
- to_sql_checked ! ( ) ;
1056
- }
1057
-
1058
1037
macro_rules! simple_to {
1059
1038
( $t: ty, $f: ident, $( $expected: ident) ,+) => {
1060
1039
impl ToSql for $t {
0 commit comments