11use std:: error:: Error ;
2- use postgres :: types:: { FromSql , IsNull , Kind , ToSql , Type } ;
2+ use postgres_shared :: types:: { FromSql , IsNull , Kind , ToSql , Type } ;
33use postgres_protocol:: { self as protocol, types} ;
44
55use { BoundSided , BoundType , Normalizable , Range , RangeBound } ;
@@ -116,6 +116,7 @@ mod test {
116116
117117 use postgres:: { Connection , TlsMode } ;
118118 use postgres:: types:: { FromSql , ToSql } ;
119+ #[ cfg( feature = "with-time" ) ]
119120 use time:: { self , Timespec } ;
120121
121122 macro_rules! test_range {
@@ -163,6 +164,7 @@ mod test {
163164 test_range ! ( "INT8RANGE" , i64 , 100i64 , "100" , 200i64 , "200" )
164165 }
165166
167+ #[ cfg( feature = "with-time" ) ]
166168 fn test_timespec_range_params ( sql_type : & str ) {
167169 fn t ( time : & str ) -> Timespec {
168170 time:: strptime ( time, "%Y-%m-%d" ) . unwrap ( ) . to_timespec ( )
@@ -173,11 +175,13 @@ mod test {
173175 }
174176
175177 #[ test]
178+ #[ cfg( feature = "with-time" ) ]
176179 fn test_tsrange_params ( ) {
177180 test_timespec_range_params ( "TSRANGE" ) ;
178181 }
179182
180183 #[ test]
184+ #[ cfg( feature = "with-time" ) ]
181185 fn test_tstzrange_params ( ) {
182186 test_timespec_range_params ( "TSTZRANGE" ) ;
183187 }
0 commit comments