@@ -1153,21 +1153,21 @@ async fn test_request_timeout() {
11531153
11541154 let mut query: Query = Query :: new ( "SELECT * FROM system_schema.tables" ) ;
11551155 query. set_request_timeout ( Some ( Duration :: from_millis ( 1 ) ) ) ;
1156- match session . query_unpaged ( query , & [ ] ) . await {
1157- Ok ( _ ) => panic ! ( "the query should have failed due to a client-side timeout" ) ,
1158- Err ( e ) => assert_matches ! ( e , ExecutionError :: RequestTimeout ( _) ) ,
1159- }
1156+ assert_matches ! (
1157+ session . query_unpaged ( query, & [ ] ) . await ,
1158+ Err ( ExecutionError :: RequestTimeout ( _) )
1159+ ) ;
11601160
11611161 let mut prepared = session
11621162 . prepare ( "SELECT * FROM system_schema.tables" )
11631163 . await
11641164 . unwrap ( ) ;
11651165
11661166 prepared. set_request_timeout ( Some ( Duration :: from_millis ( 1 ) ) ) ;
1167- match session . execute_unpaged ( & prepared , & [ ] ) . await {
1168- Ok ( _ ) => panic ! ( "the prepared query should have failed due to a client-side timeout" ) ,
1169- Err ( e ) => assert_matches ! ( e , ExecutionError :: RequestTimeout ( _) ) ,
1170- } ;
1167+ assert_matches ! (
1168+ session . execute_unpaged ( & prepared, & [ ] ) . await ,
1169+ Err ( ExecutionError :: RequestTimeout ( _) )
1170+ ) ;
11711171 }
11721172 {
11731173 let timeouting_session = create_new_session_builder ( )
@@ -1178,10 +1178,10 @@ async fn test_request_timeout() {
11781178
11791179 let mut query = Query :: new ( "SELECT * FROM system_schema.tables" ) ;
11801180
1181- match timeouting_session . query_unpaged ( query . clone ( ) , & [ ] ) . await {
1182- Ok ( _ ) => panic ! ( "the query should have failed due to a client-side timeout" ) ,
1183- Err ( e ) => assert_matches ! ( e , ExecutionError :: RequestTimeout ( _) ) ,
1184- } ;
1181+ assert_matches ! (
1182+ timeouting_session . query_unpaged ( query . clone ( ) , & [ ] ) . await ,
1183+ Err ( ExecutionError :: RequestTimeout ( _) )
1184+ ) ;
11851185
11861186 query. set_request_timeout ( Some ( Duration :: from_secs ( 10000 ) ) ) ;
11871187
@@ -1194,10 +1194,10 @@ async fn test_request_timeout() {
11941194 . await
11951195 . unwrap ( ) ;
11961196
1197- match timeouting_session . execute_unpaged ( & prepared , & [ ] ) . await {
1198- Ok ( _ ) => panic ! ( "the prepared query should have failed due to a client-side timeout" ) ,
1199- Err ( e ) => assert_matches ! ( e , ExecutionError :: RequestTimeout ( _) ) ,
1200- } ;
1197+ assert_matches ! (
1198+ timeouting_session . execute_unpaged ( & prepared, & [ ] ) . await ,
1199+ Err ( ExecutionError :: RequestTimeout ( _) )
1200+ ) ;
12011201
12021202 prepared. set_request_timeout ( Some ( Duration :: from_secs ( 10000 ) ) ) ;
12031203
0 commit comments