Skip to content
Snippets Groups Projects
Unverified Commit e7de965c authored by Sergey V's avatar Sergey V
Browse files

refactor: cosmetics

parent 61ea1dfe
No related branches found
No related tags found
1 merge request!24refactor: cosmetics
Pipeline #3458 passed
......@@ -117,7 +117,7 @@ fn main_run() {
..Default::default()
};
std::env::var("PICODATA_DATA_DIR").ok().and_then(|v| {
std::env::var("PICODATA_DATA_DIR").ok().map(|v| {
std::fs::create_dir_all(&v).unwrap();
cfg.wal_dir = v.clone();
cfg.memtx_dir = v.clone();
......@@ -135,7 +135,7 @@ fn main_run() {
let node = traft::Node::new(&raft_cfg, handle_committed_data).unwrap();
stash.set_raft_node(node);
std::env::var("PICODATA_LISTEN").ok().and_then(|v| {
std::env::var("PICODATA_LISTEN").ok().map(|v| {
cfg.listen = Some(v.clone());
Some(v)
});
......@@ -166,7 +166,7 @@ fn handle_committed_data(data: &[u8]) {
match Message::try_from(data) {
Ok(x) => match x {
EvalLua { code } => crate::tarantool::eval(&code),
Info { msg } => tlog!(Info, "{}", msg),
Info { msg } => tlog!(Info, "{msg}"),
Empty => {}
},
Err(why) => tlog!(Error, "cannot decode raft entry data: {}", why),
......
use std::ffi::CStr;
use tarantool::global_lua;
use tarantool::tlua::{self, LuaFunction};
......
use std::convert::TryFrom;
use ::raft::prelude as raft;
use ::raft::Error as RaftError;
use ::raft::StorageError;
use ::tarantool::index::IteratorType;
use ::tarantool::space::Space;
use ::tarantool::tuple::Tuple;
use std::convert::TryFrom;
use serde::de::DeserializeOwned;
use serde::Serialize;
use crate::tlog;
use crate::traft::row;
use serde::de::DeserializeOwned;
use serde::Serialize;
pub struct Storage;
pub const SPACE_RAFT_STATE: &'static str = "raft_state";
pub const SPACE_RAFT_LOG: &'static str = "raft_log";
pub const SPACE_RAFT_STATE: &str = "raft_state";
pub const SPACE_RAFT_LOG: &str = "raft_log";
impl Storage {
pub fn init_schema() {
......
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