Skip to content

Commit c3c833e

Browse files
committed
some optimizations and improvements
1 parent 0497bdb commit c3c833e

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

packages/cubejs-backend-native/src/node_export.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -511,14 +511,14 @@ fn debug_js_to_clrepr_to_js(mut cx: FunctionContext) -> JsResult<JsValue> {
511511
fn parse_cubestore_ws_result_message(mut cx: FunctionContext) -> JsResult<JsValue> {
512512
let msg = cx.argument::<JsBuffer>(0)?;
513513
let msg_data = msg.as_slice(&cx);
514-
match parse_cubestore_ws_result(msg_data.to_vec()) {
514+
match parse_cubestore_ws_result(msg_data) {
515515
Ok(result) => {
516516
let js_array = JsArray::new(&mut cx, result.len());
517517
for (i, row) in result.into_iter().enumerate() {
518518
let js_row = JsObject::new(&mut cx);
519-
for (key, value) in row {
520-
let js_key = cx.string(key);
521-
let js_value = cx.string(value);
519+
for (key, value) in row.into_iter() {
520+
let js_key = cx.string(&key);
521+
let js_value = cx.string(&value);
522522
js_row.set(&mut cx, js_key, js_value)?;
523523
}
524524
js_array.set(&mut cx, i as u32, js_row)?;

rust/cubeorchestrator/rustfmt.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
imports_granularity = "Crate"
1+
imports_granularity = "Crate"

rust/cubeorchestrator/src/cubestore_message_parser.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ impl std::fmt::Display for ParseError {
2929
impl std::error::Error for ParseError {}
3030

3131
pub fn parse_cubestore_ws_result(
32-
msg_data: Vec<u8>,
32+
msg_data: &[u8],
3333
) -> Result<Vec<HashMap<String, String>>, ParseError> {
3434
let http_message =
35-
root_as_http_message(msg_data.as_slice()).map_err(|_| ParseError::FlatBufferError)?;
35+
root_as_http_message(msg_data).map_err(|_| ParseError::FlatBufferError)?;
3636

3737
let command_type = http_message.command_type();
3838

0 commit comments

Comments
 (0)