@@ -914,8 +914,8 @@ fn test_http_sql() {
914914
915915 f. run ( |tc| {
916916 let msg = match tc. directive . as_str ( ) {
917- "ws-text" => Message :: Text ( tc. input . clone ( ) ) ,
918- "ws-binary" => Message :: Binary ( tc. input . as_bytes ( ) . to_vec ( ) ) ,
917+ "ws-text" => Message :: text ( & tc. input ) ,
918+ "ws-binary" => Message :: Binary ( tc. input . clone ( ) . into ( ) ) ,
919919 "http" => {
920920 let json: serde_json:: Value = serde_json:: from_str ( & tc. input ) . unwrap ( ) ;
921921 let res = Client :: new ( )
@@ -938,12 +938,12 @@ fn test_http_sql() {
938938 loop {
939939 let resp = ws. read ( ) . unwrap ( ) ;
940940 match resp {
941- Message :: Text ( mut msg) => {
942- if fixtimestamp {
943- msg = fixtimestamp_re
944- . replace_all ( & msg , fixtimestamp_replace )
945- . into ( ) ;
946- }
941+ Message :: Text ( msg) => {
942+ let msg = if fixtimestamp {
943+ fixtimestamp_re . replace_all ( & msg, fixtimestamp_replace )
944+ } else {
945+ msg . as_str ( ) . into ( )
946+ } ;
947947 let msg: WebSocketResponse = serde_json:: from_str ( & msg) . unwrap ( ) ;
948948 write ! ( & mut responses, "{}\n " , serde_json:: to_string( & msg) . unwrap( ) )
949949 . unwrap ( ) ;
@@ -1742,7 +1742,7 @@ fn test_max_request_size() {
17421742 let json =
17431743 format ! ( "{{\" queries\" :[{{\" query\" :\" {statement}\" ,\" params\" :[\" {param}\" ]}}]}}" ) ;
17441744 let json: serde_json:: Value = serde_json:: from_str ( & json) . unwrap ( ) ;
1745- ws. send ( Message :: Text ( json. to_string ( ) ) ) . unwrap ( ) ;
1745+ ws. send ( Message :: text ( json. to_string ( ) ) ) . unwrap ( ) ;
17461746
17471747 // The specific error isn't forwarded to the client, the connection is just closed.
17481748 let err = ws. read ( ) . unwrap_err ( ) ;
@@ -1819,7 +1819,7 @@ fn test_max_statement_batch_size() {
18191819 test_util:: auth_with_ws ( & mut ws, BTreeMap :: default ( ) ) . unwrap ( ) ;
18201820 let json = format ! ( "{{\" query\" :\" {statements}\" }}" ) ;
18211821 let json: serde_json:: Value = serde_json:: from_str ( & json) . unwrap ( ) ;
1822- ws. send ( Message :: Text ( json. to_string ( ) ) ) . unwrap ( ) ;
1822+ ws. send ( Message :: text ( json. to_string ( ) ) ) . unwrap ( ) ;
18231823
18241824 // Discard the CommandStarting message
18251825 let _ = ws. read ( ) . unwrap ( ) ;
@@ -1875,7 +1875,7 @@ fn test_ws_passes_options() {
18751875 // set from the options map we passed with the auth.
18761876 let json = "{\" query\" :\" SHOW application_name;\" }" ;
18771877 let json: serde_json:: Value = serde_json:: from_str ( json) . unwrap ( ) ;
1878- ws. send ( Message :: Text ( json. to_string ( ) ) ) . unwrap ( ) ;
1878+ ws. send ( Message :: text ( json. to_string ( ) ) ) . unwrap ( ) ;
18791879
18801880 let mut read_msg = || -> WebSocketResponse {
18811881 let msg = ws. read ( ) . unwrap ( ) ;
@@ -1930,7 +1930,7 @@ fn test_ws_subscribe_no_crash() {
19301930 let query = "SUBSCRIBE (SELECT 1)" ;
19311931 let json = format ! ( "{{\" query\" :\" {query}\" }}" ) ;
19321932 let json: serde_json:: Value = serde_json:: from_str ( & json) . unwrap ( ) ;
1933- ws. send ( Message :: Text ( json. to_string ( ) ) ) . unwrap ( ) ;
1933+ ws. send ( Message :: text ( json. to_string ( ) ) ) . unwrap ( ) ;
19341934
19351935 // Give the server time to crash, if it's going to.
19361936 std:: thread:: sleep ( Duration :: from_secs ( 1 ) )
@@ -2143,7 +2143,7 @@ fn test_max_connections_on_all_interfaces() {
21432143 test_util:: auth_with_ws ( & mut ws, BTreeMap :: default ( ) ) . unwrap ( ) ;
21442144 let json = format ! ( "{{\" query\" :\" {query}\" }}" ) ;
21452145 let json: serde_json:: Value = serde_json:: from_str ( & json) . unwrap ( ) ;
2146- ws. send ( Message :: Text ( json. to_string ( ) ) ) . unwrap ( ) ;
2146+ ws. send ( Message :: text ( json. to_string ( ) ) ) . unwrap ( ) ;
21472147
21482148 // The specific error isn't forwarded to the client, the connection is just closed.
21492149 match ws. read ( ) {
@@ -2154,13 +2154,13 @@ fn test_max_connections_on_all_interfaces() {
21542154 ) ;
21552155 assert_eq ! (
21562156 ws. read( ) . unwrap( ) ,
2157- Message :: Text ( format!(
2157+ Message :: text ( format!(
21582158 r#"{{"type":"Rows","payload":{{"columns":[{{"name":"{UNKNOWN_COLUMN_NAME}","type_oid":23,"type_len":4,"type_mod":-1}}]}}}}"#
21592159 ) )
21602160 ) ;
21612161 assert_eq ! (
21622162 ws. read( ) . unwrap( ) ,
2163- Message :: Text ( "{\" type\" :\" Row\" ,\" payload\" :[\" 1\" ]}" . to_string ( ) )
2163+ Message :: text ( "{\" type\" :\" Row\" ,\" payload\" :[\" 1\" ]}" )
21642164 ) ;
21652165 tracing:: info!( "data: {:?}" , ws. read( ) . unwrap( ) ) ;
21662166 }
@@ -2593,15 +2593,15 @@ fn test_internal_ws_auth() {
25932593 // Auth with OptionsOnly
25942594 test_util:: auth_with_ws_impl (
25952595 & mut ws,
2596- Message :: Text ( serde_json:: to_string ( & WebSocketAuth :: OptionsOnly { options } ) . unwrap ( ) ) ,
2596+ Message :: text ( serde_json:: to_string ( & WebSocketAuth :: OptionsOnly { options } ) . unwrap ( ) ) ,
25972597 )
25982598 . unwrap ( ) ;
25992599
26002600 // Query to make sure we get back the correct user, which should be
26012601 // set from the headers passed with the websocket request.
26022602 let json = "{\" query\" :\" SELECT current_user;\" }" ;
26032603 let json: serde_json:: Value = serde_json:: from_str ( json) . unwrap ( ) ;
2604- ws. send ( Message :: Text ( json. to_string ( ) ) ) . unwrap ( ) ;
2604+ ws. send ( Message :: text ( json. to_string ( ) ) ) . unwrap ( ) ;
26052605
26062606 let mut read_msg = || -> WebSocketResponse {
26072607 let msg = ws. read ( ) . unwrap ( ) ;
@@ -2768,7 +2768,7 @@ fn test_cancel_ws() {
27682768 test_util:: auth_with_ws ( & mut ws, BTreeMap :: default ( ) ) . unwrap ( ) ;
27692769 let json = r#"{"queries":[{"query":"SUBSCRIBE t"}]}"# ;
27702770 let json: serde_json:: Value = serde_json:: from_str ( json) . unwrap ( ) ;
2771- ws. send ( Message :: Text ( json. to_string ( ) ) ) . unwrap ( ) ;
2771+ ws. send ( Message :: text ( json. to_string ( ) ) ) . unwrap ( ) ;
27722772
27732773 loop {
27742774 let msg = ws. read ( ) . unwrap ( ) ;
@@ -2861,7 +2861,10 @@ async fn smoketest_webhook_source() {
28612861 assert_eq ! ( total_requests_metric. get_counter( ) . get_value( ) , 100.0 ) ;
28622862
28632863 let path_label = & total_requests_metric. get_label ( ) [ 0 ] ;
2864- assert_eq ! ( path_label. value( ) , "/api/webhook/:database/:schema/:id" ) ;
2864+ assert_eq ! (
2865+ path_label. value( ) ,
2866+ "/api/webhook/{:database}/{:schema}/{:id}"
2867+ ) ;
28652868
28662869 let status_label = & total_requests_metric. get_label ( ) [ 2 ] ;
28672870 assert_eq ! ( status_label. value( ) , "200" ) ;
@@ -3057,10 +3060,10 @@ fn test_github_20262() {
30573060
30583061 let ( mut ws, _resp) = tungstenite:: connect ( server. ws_addr ( ) ) . unwrap ( ) ;
30593062 test_util:: auth_with_ws ( & mut ws, BTreeMap :: default ( ) ) . unwrap ( ) ;
3060- ws. send ( Message :: Text ( subscribe) ) . unwrap ( ) ;
3063+ ws. send ( Message :: text ( subscribe) ) . unwrap ( ) ;
30613064 cancel ( ) ;
3062- ws. send ( Message :: Text ( commit) ) . unwrap ( ) ;
3063- ws. send ( Message :: Text ( select) ) . unwrap ( ) ;
3065+ ws. send ( Message :: text ( commit) ) . unwrap ( ) ;
3066+ ws. send ( Message :: text ( select) ) . unwrap ( ) ;
30643067
30653068 let mut expect = VecDeque :: from ( [
30663069 r#"{"type":"CommandStarting","payload":{"has_rows":true,"is_streaming":true}}"# . to_string ( ) ,
@@ -4353,7 +4356,7 @@ async fn test_double_encoded_json() {
43534356
43544357 let json = "{\" query\" :\" SELECT a FROM t1 ORDER BY a;\" }" ;
43554358 let json: serde_json:: Value = serde_json:: from_str ( json) . unwrap ( ) ;
4356- ws. send ( Message :: Text ( json. to_string ( ) ) ) . unwrap ( ) ;
4359+ ws. send ( Message :: text ( json. to_string ( ) ) ) . unwrap ( ) ;
43574360
43584361 let mut read_msg = || -> WebSocketResponse {
43594362 let msg = ws. read ( ) . unwrap ( ) ;
0 commit comments