Skip to content

Commit 8f9ee7a

Browse files
committed
remove: utf8
1 parent b9f6e00 commit 8f9ee7a

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

frameworks/Rust/hyperlane/src/constant.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
pub static RESPONSEDATA: &str = "Hello, World!";
1+
pub static RESPONSEDATA_STR: &str = "Hello, World!";
2+
pub static RESPONSEDATA_BIN: &[u8] = b"Hello, World!";
23
pub static DATABASE_TYPE: &str = "postgres";
34
pub static DATABASE_HOST: &str = "tfb-database";
45
pub static DATABASE_USER_NAME: &str = "benchmarkdbuser";

frameworks/Rust/hyperlane/src/main.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ pub(crate) mod utils;
1111
pub(crate) use constant::*;
1212
pub(crate) use db::*;
1313
pub(crate) use futures::future::join_all;
14-
pub(crate) use hyperlane::{once_cell::sync::OnceCell, serde::*, serde_json::json, *};
14+
pub(crate) use hyperlane::{
15+
once_cell::sync::OnceCell,
16+
serde::*,
17+
serde_json::{Value, json},
18+
*,
19+
};
1520
pub(crate) use lazy::*;
1621
pub(crate) use rand::{Rng, SeedableRng, rng, rngs::SmallRng};
1722
pub(crate) use request_middleware::*;

frameworks/Rust/hyperlane/src/request_middleware.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pub async fn request(controller_data: ControllerData) {
44
let _ = controller_data
55
.set_response_header(CONNECTION, CONNECTION_KEEP_ALIVE)
66
.await
7-
.set_response_header(CONTENT_TYPE, content_type_charset(APPLICATION_JSON, UTF8))
7+
.set_response_header(CONTENT_TYPE, APPLICATION_JSON)
88
.await
99
.set_response_header(SERVER, HYPERLANE)
1010
.await

frameworks/Rust/hyperlane/src/route.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use crate::*;
22

33
pub async fn json(controller_data: ControllerData) {
4-
let json: serde_json::Value = json!({
5-
"message": RESPONSEDATA
4+
let json: Value = json!({
5+
"message": RESPONSEDATA_STR
66
});
77
let _ = controller_data
88
.set_response_body(serde_json::to_string(&json).unwrap_or_default())
@@ -11,9 +11,9 @@ pub async fn json(controller_data: ControllerData) {
1111

1212
pub async fn plaintext(controller_data: ControllerData) {
1313
let _ = controller_data
14-
.set_response_header(CONTENT_TYPE, content_type_charset(TEXT_PLAIN, UTF8))
14+
.set_response_header(CONTENT_TYPE, TEXT_PLAIN)
1515
.await
16-
.set_response_body(RESPONSEDATA)
16+
.set_response_body(RESPONSEDATA_BIN)
1717
.await;
1818
}
1919

0 commit comments

Comments
 (0)