@@ -161,8 +161,8 @@ async fn test_timestamp() {
161
161
type_check :: < _ , sql_types:: Timestamp > (
162
162
conn,
163
163
chrono:: NaiveDateTime :: new (
164
- chrono:: NaiveDate :: from_ymd ( 2021 , 09 , 27 ) ,
165
- chrono:: NaiveTime :: from_hms_milli ( 17 , 44 , 23 , 0 ) ,
164
+ chrono:: NaiveDate :: from_ymd_opt ( 2021 , 09 , 27 ) . unwrap ( ) ,
165
+ chrono:: NaiveTime :: from_hms_milli_opt ( 17 , 44 , 23 , 0 ) . unwrap ( ) ,
166
166
) ,
167
167
)
168
168
. await ;
@@ -171,13 +171,18 @@ async fn test_timestamp() {
171
171
#[ tokio:: test]
172
172
async fn test_date ( ) {
173
173
let conn = & mut connection ( ) . await ;
174
- type_check :: < _ , sql_types:: Date > ( conn, chrono:: NaiveDate :: from_ymd ( 2021 , 09 , 27 ) ) . await ;
174
+ type_check :: < _ , sql_types:: Date > ( conn, chrono:: NaiveDate :: from_ymd_opt ( 2021 , 09 , 27 ) . unwrap ( ) )
175
+ . await ;
175
176
}
176
177
177
178
#[ tokio:: test]
178
179
async fn test_time ( ) {
179
180
let conn = & mut connection ( ) . await ;
180
- type_check :: < _ , sql_types:: Time > ( conn, chrono:: NaiveTime :: from_hms_milli ( 17 , 44 , 23 , 0 ) ) . await ;
181
+ type_check :: < _ , sql_types:: Time > (
182
+ conn,
183
+ chrono:: NaiveTime :: from_hms_milli_opt ( 17 , 44 , 23 , 0 ) . unwrap ( ) ,
184
+ )
185
+ . await ;
181
186
}
182
187
183
188
#[ cfg( feature = "mysql" ) ]
@@ -187,8 +192,8 @@ async fn test_datetime() {
187
192
type_check :: < _ , sql_types:: Datetime > (
188
193
conn,
189
194
chrono:: NaiveDateTime :: new (
190
- chrono:: NaiveDate :: from_ymd ( 2021 , 09 , 30 ) ,
191
- chrono:: NaiveTime :: from_hms_milli ( 12 , 06 , 42 , 0 ) ,
195
+ chrono:: NaiveDate :: from_ymd_opt ( 2021 , 09 , 30 ) . unwrap ( ) ,
196
+ chrono:: NaiveTime :: from_hms_milli_opt ( 12 , 06 , 42 , 0 ) . unwrap ( ) ,
192
197
) ,
193
198
)
194
199
. await ;
0 commit comments