Skip to content
Snippets Groups Projects
Commit 7ebe1d66 authored by Igor Kuznetsov's avatar Igor Kuznetsov
Browse files

refactoring: fix clippy warn

parent 1206a4d6
No related branches found
No related tags found
1 merge request!1414sbroad import
......@@ -32,14 +32,14 @@ impl Serialize for Value {
impl Eq for Value {}
#[derive(LuaRead, Debug, PartialEq, Eq)]
pub struct BoxExecuteResult {
pub struct BoxExecuteFormat {
pub metadata: Vec<Column>,
pub rows: Vec<Vec<Value>>,
}
/// Custom Implementation `ser::Serialize`, because if using standard `#derive[Serialize]` then each `BoxExecuteResult`
/// record is serialized to a list. That is not the result we expect.
impl Serialize for BoxExecuteResult {
impl Serialize for BoxExecuteFormat {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
......
......@@ -6,7 +6,7 @@ use super::*;
#[test]
fn box_execute_result_serialize() {
let r = BoxExecuteResult {
let r = BoxExecuteFormat {
metadata: vec![
Column {
name: "id".into(),
......
......@@ -328,7 +328,7 @@ impl Plan {
false
}
} else {
result.push(r_id);
result.push(r_id);
true
}
})
......
use crate::executor::result::BoxExecuteResult;
use crate::executor::result::BoxExecuteFormat;
use tarantool::ffi::tarantool::luaT_state;
use tarantool::hlua::{Lua, LuaError, LuaFunction};
use tarantool::log::{say, SayLevel};
......@@ -14,7 +14,7 @@ pub fn get_cluster_schema() -> Result<String, LuaError> {
}
/// Function execute sql query on selected node
pub fn exec_query(bucket_id: u64, query: &str) -> Result<BoxExecuteResult, LuaError> {
pub fn exec_query(bucket_id: u64, query: &str) -> Result<BoxExecuteFormat, LuaError> {
let lua = unsafe { Lua::from_existing_state(luaT_state(), false) };
lua.exec(
......@@ -40,7 +40,7 @@ pub fn exec_query(bucket_id: u64, query: &str) -> Result<BoxExecuteResult, LuaEr
)?;
let exec_sql: LuaFunction<_> = lua.get("execute_sql").unwrap();
let res: BoxExecuteResult = exec_sql.call_with_args((bucket_id, query))?;
let res: BoxExecuteFormat = exec_sql.call_with_args((bucket_id, query))?;
say(
SayLevel::Error,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment