@@ -959,21 +959,21 @@ async fn test_request_timeout() {
959959
960960 let mut query: Query = Query :: new ( "SELECT * FROM system_schema.tables" ) ;
961961 query. set_request_timeout ( Some ( Duration :: from_millis ( 1 ) ) ) ;
962- match session . query_unpaged ( query , & [ ] ) . await {
963- Ok ( _ ) => panic ! ( "the query should have failed due to a client-side timeout" ) ,
964- Err ( e ) => assert_matches ! ( e , ExecutionError :: RequestTimeout ( _) ) ,
965- }
962+ assert_matches ! (
963+ session . query_unpaged ( query, & [ ] ) . await ,
964+ Err ( ExecutionError :: RequestTimeout ( _) )
965+ ) ;
966966
967967 let mut prepared = session
968968 . prepare ( "SELECT * FROM system_schema.tables" )
969969 . await
970970 . unwrap ( ) ;
971971
972972 prepared. set_request_timeout ( Some ( Duration :: from_millis ( 1 ) ) ) ;
973- match session . execute_unpaged ( & prepared , & [ ] ) . await {
974- Ok ( _ ) => panic ! ( "the prepared query should have failed due to a client-side timeout" ) ,
975- Err ( e ) => assert_matches ! ( e , ExecutionError :: RequestTimeout ( _) ) ,
976- } ;
973+ assert_matches ! (
974+ session . execute_unpaged ( & prepared, & [ ] ) . await ,
975+ Err ( ExecutionError :: RequestTimeout ( _) )
976+ ) ;
977977 }
978978 {
979979 let timeouting_session = create_new_session_builder ( )
@@ -984,10 +984,10 @@ async fn test_request_timeout() {
984984
985985 let mut query = Query :: new ( "SELECT * FROM system_schema.tables" ) ;
986986
987- match timeouting_session . query_unpaged ( query . clone ( ) , & [ ] ) . await {
988- Ok ( _ ) => panic ! ( "the query should have failed due to a client-side timeout" ) ,
989- Err ( e ) => assert_matches ! ( e , ExecutionError :: RequestTimeout ( _) ) ,
990- } ;
987+ assert_matches ! (
988+ timeouting_session . query_unpaged ( query . clone ( ) , & [ ] ) . await ,
989+ Err ( ExecutionError :: RequestTimeout ( _) )
990+ ) ;
991991
992992 query. set_request_timeout ( Some ( Duration :: from_secs ( 10000 ) ) ) ;
993993
@@ -1000,10 +1000,10 @@ async fn test_request_timeout() {
10001000 . await
10011001 . unwrap ( ) ;
10021002
1003- match timeouting_session . execute_unpaged ( & prepared , & [ ] ) . await {
1004- Ok ( _ ) => panic ! ( "the prepared query should have failed due to a client-side timeout" ) ,
1005- Err ( e ) => assert_matches ! ( e , ExecutionError :: RequestTimeout ( _) ) ,
1006- } ;
1003+ assert_matches ! (
1004+ timeouting_session . execute_unpaged ( & prepared, & [ ] ) . await ,
1005+ Err ( ExecutionError :: RequestTimeout ( _) )
1006+ ) ;
10071007
10081008 prepared. set_request_timeout ( Some ( Duration :: from_secs ( 10000 ) ) ) ;
10091009
0 commit comments